Class VisualScript
The Visual Script asset. Contains a graph with functions and parameters for visual scripting.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Content/Assets/VisualScript.h
Syntax
public class VisualScript : public BinaryAsset
Fields
Graph
Meta
The script metadata.
Declaration
public Metadata Meta
Field Value
Metadata
|
Methods
CreateInstance()
Creates a new instance of the Visual Script object.
Declaration
public ScriptingObject* CreateInstance()
Returns
ScriptingObject
The created instance or null if failed. |
FindField(const StringAnsiView& name)
Tries to find the field matching the given name. Doesn't check base classes but just this script.
Declaration
public Field* FindField(const StringAnsiView& name) const
Parameters
StringAnsiView
name
The field name. |
Returns
Field
The field entry for access, null if not found. |
FindMethod(const StringAnsiView& name, int32 numParams = 0)
Tries to find the method matching the given properties. Doesn't check base classes but just this script.
Declaration
public Method* FindMethod(const StringAnsiView& name, int32 numParams = 0) const
Parameters
StringAnsiView
name
The method name. |
int32
numParams
The method parameters count. |
Returns
Method
The method graph node entry for callback, null if not found. |
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
GetMetaData(int32 typeID)
Declaration
public Span<byte> GetMetaData(int32 typeID)
Parameters
int32
typeID
|
Returns
Span<byte>
|
GetMethodMetaData(int32 index, int32 typeID)
Declaration
public Span<byte> GetMethodMetaData(int32 index, int32 typeID)
Parameters
int32
index
|
int32
typeID
|
Returns
Span<byte>
|
GetMethodsCount()
Declaration
public int32 GetMethodsCount() const
Returns
int32
|
GetMethodSignature(int32 index, String& name, byte& flags, String& returnTypeName, Array<String>& paramNames, Array<String>& paramTypeNames, Array<bool>& paramOuts)
Declaration
public void GetMethodSignature(int32 index, String& name, byte& flags, String& returnTypeName, Array<String>& paramNames, Array<String>& paramTypeNames, Array<bool>& paramOuts)
Parameters
int32
index
|
String
name
|
byte
flags
|
String
returnTypeName
|
Array<String>
paramNames
|
Array<String>
paramTypeNames
|
Array<bool>
paramOuts
|
GetParameters()
Gets the list of Visual Script parameters declared in this graph (excluding base types).
Declaration
public Array<VisjectGraphParameter> GetParameters() const
Returns
Array<VisjectGraphParameter>
|
GetReferences(Array<Guid>& assets, Array<String>& files)
Declaration
public void GetReferences(Array<Guid>& assets, Array<String>& files) const override
Parameters
Array<Guid>
assets
|
Array<String>
files
|
GetScriptingType()
Gets the scripting type handle of this Visual Script.
Declaration
public ScriptingTypeHandle GetScriptingType()
Returns
ScriptingTypeHandle
|
GetScriptInstance(ScriptingObject* instance)
Gets the Visual Script instance data.
Declaration
public Instance* GetScriptInstance(ScriptingObject* instance) const
Parameters
ScriptingObject
instance
The object instance. |
Returns
Instance
The data or invalid instance (not VS or missing). |
GetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance)
Gets the value of the Visual Script parameter of the given instance.
Declaration
public Variant GetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance) const
Parameters
StringView
name
The parameter name. |
ScriptingObject
instance
The object instance. |
Returns
Variant
The property value. |
GetScriptTypeName()
Gets the typename of the Visual Script. Identifies it's scripting type.
Declaration
public StringAnsiView GetScriptTypeName() const
Returns
StringAnsiView
|
InvokeMethod(int32 index, const Variant& instance, Span<Variant> parameters)
Declaration
public Variant InvokeMethod(int32 index, const Variant& instance, Span<Variant> parameters) const
Parameters
int32
index
|
Variant
instance
|
Span<Variant>
parameters
|
Returns
Variant
|
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
LoadSurface()
Tries to load surface graph from the asset.
Declaration
public BytesContainer LoadSurface() const
Returns
BytesContainer
The surface data or empty if failed to load it. |
Save(const StringView& path=StringView::Empty)
Saves this asset to the file. Supported only in Editor.
Declaration
public virtual bool Save(const StringView& path=StringView::Empty) override
Parameters
StringView
path
The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset. |
Returns
bool
True when cannot save data, otherwise false. |
Overrides
SaveSurface(const BytesContainer& data, const Metadata& meta)
Updates the graph surface (save new one, discard cached data, reload asset).
Declaration
public bool SaveSurface(const BytesContainer& data, const Metadata& meta) const
Parameters
BytesContainer
data
Stream with graph data. |
Metadata
meta
Script metadata. |
Returns
bool
True if cannot save it, otherwise false. |
SetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance, const Variant& value)
Sets the value of the Visual Script parameter of the given instance.
Declaration
public void SetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance, const Variant& value)
Parameters
StringView
name
The parameter name. |
ScriptingObject
instance
The object instance. |
Variant
value
The property value to set. |
SetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance, Variant&& value)
Sets the value of the Visual Script parameter of the given instance.
Declaration
public void SetScriptInstanceParameterValue(const StringView& name, ScriptingObject* instance, Variant&& value)
Parameters
StringView
name
The parameter name. |
ScriptingObject
instance
The object instance. |
Variant
value
The property value to set. |
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |