BsScriptSerializedObject.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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_Create(MonoObject* obj);
  25. static MonoObject* internal_Deserialize(ScriptSerializedObject* thisPtr);
  26. };
  27. /** @} */
  28. }