BsScriptSerializedObject.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEditorPrerequisites.h"
  5. #include "BsScriptObject.h"
  6. namespace bs
  7. {
  8. /** @addtogroup ScriptInteropEditor
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for SerializedObject. */
  12. class BS_SCR_BED_EXPORT ScriptSerializedObject : public ScriptObject <ScriptSerializedObject>
  13. {
  14. public:
  15. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "SerializedObject")
  16. /** Returns the serialized object wrapped by this object. */
  17. SPtr<IReflectable> getInternal() const { return mSerializedObject; }
  18. private:
  19. ScriptSerializedObject(MonoObject* instance, const SPtr<IReflectable>& obj);
  20. SPtr<IReflectable> mSerializedObject;
  21. /************************************************************************/
  22. /* CLR HOOKS */
  23. /************************************************************************/
  24. static MonoObject* internal_CreateComponent(ScriptComponentBase* componentPtr);
  25. static MonoObject* internal_CreateResource(ScriptManagedResource* resourcePtr);
  26. static MonoObject* internal_CreateGeneric(MonoObject* obj);
  27. static MonoObject* internal_Deserialize(ScriptSerializedObject* thisPtr);
  28. };
  29. /** @} */
  30. }