class TScriptObjectWrapper

template<typename SelfType, typename BaseType = ScriptObjectWrapper>
Inherits: BaseType, TScriptTypeDefinition<SelfType>

Provides common functionality required by specializations of ScriptObjectWrapper, including a meta-data object to store information about the type, ability to bind the script object wrapper to the script object, and retrieve the wrapper from the script object

Template parameters

SelfType

Type that is deriving from TScriptObjectWrapper.

BaseType

Type that TScriptObjectWrapper should inherit from. This type must be ScriptObjectWrapper, or a type deriving from it.

Public

Constructors

TScriptObjectWrapper<SelfType, BaseType>

TScriptObjectWrapper<SelfType, BaseType>(IScriptExportable *nativeObject)

Methods

~TScriptObjectWrapper<SelfType, BaseType>

virtual ~TScriptObjectWrapper<SelfType, BaseType>() = default

RecreateScriptObjectAfterScriptReload

void RecreateScriptObjectAfterScriptReload() override

staticGetScriptObjectWrapper

static SelfType *GetScriptObjectWrapper(MonoObject *scriptObject)

Returns the script object wrapper associated with the provided script object.

staticGetMetaData

static const ScriptTypeMetaData *GetMetaData()

Returns the meta-data storing information about the script type.

staticInitializeMetaDataAtLoadTime

static void InitializeMetaDataAtLoadTime()

Takes care of initializing the meta-data when the application first load.

The meta-data will be registered with a global manager that will ensure it is kept up-to-date after operations such as assembly (re)load.

Protected

Methods

BindToScriptObject

void BindToScriptObject(MonoObject *scriptObject) override

Stores a pointer to itself in the script object.

This ensures that calls to GetScriptObjectWrapper() can return the script object wrapper associated with the script object.