| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #pragma once
- #include "BsScriptEnginePrerequisites.h"
- #include "BsScriptObject.h"
- namespace BansheeEngine
- {
- /**
- * @brief Base class for all GameObject interop classes.
- */
- class BS_SCR_BE_EXPORT ScriptGameObjectBase : public PersistentScriptObjectBase
- {
- public:
- ScriptGameObjectBase(MonoObject* instance);
- virtual ~ScriptGameObjectBase() { }
- /**
- * @brief Returns the internal native GameObject handle.
- */
- virtual HGameObject getNativeHandle() const = 0;
- /**
- * @brief Sets the internal native GameObject handle.
- */
- virtual void setNativeHandle(const HGameObject& gameObject) = 0;
- /**
- * @copydoc ScriptObjectBase::beginRefresh
- */
- virtual ScriptObjectBackup beginRefresh() override;
- /**
- * @copydoc ScriptObjectBase::endRefresh
- */
- virtual void endRefresh(const ScriptObjectBackup& backupData) override;
- protected:
- bool mRefreshInProgress;
- };
- /**
- * @brief Interop class between C++ & CLR for GameObject.
- */
- class BS_SCR_BE_EXPORT ScriptGameObject : public ScriptObject<ScriptGameObject, ScriptGameObjectBase>
- {
- public:
- SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GameObject")
- private:
- ScriptGameObject(MonoObject* instance);
- /************************************************************************/
- /* CLR HOOKS */
- /************************************************************************/
- static UINT64 internal_getInstanceId(ScriptGameObject* nativeInstance);
- };
- }
|