Class VisualScriptingBinaryModule
The visual scripts module for engine scripting integration.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Content/Assets/VisualScript.h
Syntax
public class VisualScriptingBinaryModule : public BinaryModule
Constructors
VisualScriptingBinaryModule()
Initializes a new instance of the VisualScriptingBinaryModule class.
Declaration
public VisualScriptingBinaryModule()
Fields
Scripts
The visual script assets loaded into the module with exposes scripting types. Order matches the Types array.
Declaration
public Array<AssetReference<VisualScript>> Scripts
Field Value
Array<AssetReference<VisualScript>>
|
Methods
DeserializeObject(ISerializable::DeserializeStream& stream, ScriptingObject* object, ISerializeModifier* modifier)
Deserialize object from the input stream
Declaration
public virtual void DeserializeObject(ISerializable::DeserializeStream& stream, ScriptingObject* object, ISerializeModifier* modifier) override
Parameters
ISerializable::DeserializeStream
stream
The input stream. |
ScriptingObject
object
The object instance to deserialize. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
Destroy(bool isReloading)
Unloads the module (native library and C# assembly and any other scripting data). Unregisters the module.
Declaration
public virtual void Destroy(bool isReloading) override
Parameters
bool
isReloading
If true module is during reloading and should force release the runtime data. Used for C# assembly to clean up it's runtime data in Mono (or other scripting runtime). |
Overrides
FindField(const ScriptingTypeHandle& typeHandle, const StringAnsiView& name)
Tries to find a field in a given scripting type by the field name.
Declaration
public virtual void* FindField(const ScriptingTypeHandle& typeHandle, const StringAnsiView& name) override
Parameters
ScriptingTypeHandle
typeHandle
The type to find field inside it. |
StringAnsiView
name
The field name. |
Returns
void
The field or null if failed to get it. |
Overrides
FindMethod(const ScriptingTypeHandle& typeHandle, const StringAnsiView& name, int32 numParams = 0)
Tries to find a method in a given scripting type by the method name and parameters count.
If the type contains more than one method of the given name and parameters count the returned value can be non-deterministic (one of the matching methods).
Declaration
public virtual void* FindMethod(const ScriptingTypeHandle& typeHandle, const StringAnsiView& name, int32 numParams = 0) override
Parameters
ScriptingTypeHandle
typeHandle
The type to find method inside it. |
StringAnsiView
name
The method name. |
int32
numParams
The method parameters count. |
Returns
void
The method or null if failed to get it. |
Overrides
FindScriptingType(const StringAnsiView& typeName, int32& typeIndex)
Tries to find a given scripting type by the full name.
Declaration
public virtual bool FindScriptingType(const StringAnsiView& typeName, int32& typeIndex) override
Parameters
StringAnsiView
typeName
The full name of the type eg: System.Int64.MaxInt. |
int32
typeIndex
The result type index in Types array of this module. Valid only if method returns true. |
Returns
bool
True if found a type, otherwise false. |
Overrides
GetFieldSignature(void* field, ScriptingTypeFieldSignature& fieldSignature)
Gets the scripting type field signature metadata.
Declaration
public virtual void GetFieldSignature(void* field, ScriptingTypeFieldSignature& fieldSignature) override
Parameters
void
field
The field. |
ScriptingTypeFieldSignature
fieldSignature
The output field signature info. |
Overrides
GetFieldValue(void* field, const Variant& instance, Variant& result)
Gets the value of a given scripting field.
Declaration
public virtual bool GetFieldValue(void* field, const Variant& instance, Variant& result) override
Parameters
void
field
The field. |
Variant
instance
The object instance to get its member field. Unused for static fields. |
Variant
result
The output field value. |
Returns
bool
True if failed, otherwise false. |
Overrides
GetMethodSignature(void* method, ScriptingTypeMethodSignature& methodSignature)
Gets the scripting type method signature metadata.
Declaration
public virtual void GetMethodSignature(void* method, ScriptingTypeMethodSignature& methodSignature) override
Parameters
void
method
The method. |
ScriptingTypeMethodSignature
signature
The output method signature info. |
Overrides
GetName()
Gets the assembly name.
Declaration
public virtual StringAnsi GetName() const override
Returns
StringAnsi
The assembly name. |
Overrides
InvokeMethod(void* method, const Variant& instance, Span<Variant> paramValues, Variant& result)
Invokes a given scripting method.
Declaration
public virtual bool InvokeMethod(void* method, const Variant& instance, Span<Variant> paramValues, Variant& result) override
Parameters
void
method
The method. |
Variant
instance
The object instance to call it's member method. Unused for static methods. |
Span<Variant>
paramValues
The method parameters array. For output parameters the method writes the values back to the parameters. Length of this list has to match the method arguments amount. |
Variant
result
The output value method returned. Not used for void method. |
Returns
bool
True if failed, otherwise false. |
Overrides
IsLoaded()
Returns true if module is loaded, otherwise false (it might not be loaded yet or failed to load).
Declaration
public virtual bool IsLoaded() const override
Returns
bool
|
Overrides
OnObjectDeleted(ScriptingObject* object)
Called when object gets removed (inside destructor). Can be used to clear any cached data inside the scripting backend.
Declaration
public virtual void OnObjectDeleted(ScriptingObject* object) override
Parameters
ScriptingObject
object
The object instance. |
Overrides
OnObjectIdChanged(ScriptingObject* object, const Guid& oldId)
Called when object ID gets changed. Can be used to synchronize any cache in the scripting backend.
Declaration
public virtual void OnObjectIdChanged(ScriptingObject* object, const Guid& oldId) override
Parameters
ScriptingObject
object
The object instance. |
Guid
oldId
The previous object ID. |
Overrides
SerializeObject(JsonWriter& stream, ScriptingObject* object, const ScriptingObject* otherObj)
Serializes the scripting object data. Called for objects using IsCustomScriptingType.
Declaration
public virtual void SerializeObject(JsonWriter& stream, ScriptingObject* object, const ScriptingObject* otherObj) override
Parameters
JsonWriter
stream
The output stream. |
ScriptingObject
object
The object instance to serialize. |
ScriptingObject
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetFieldValue(void* field, const Variant& instance, Variant& value)
Sets the value of a given scripting field.
Declaration
public virtual bool SetFieldValue(void* field, const Variant& instance, Variant& value) override
Parameters
void
field
The field. |
Variant
instance
The object instance to set its member field. Unused for static fields. |
Variant
value
The field value to assign. |
Returns
bool
True if failed, otherwise false. |