Class VisualScript
The Visual Script asset. Contains a graph with functions and parameters for visual scripting.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class VisualScript : BinaryAsset
Constructors
VisualScript()
Properties
Meta
The script metadata.
Declaration
[Unmanaged]
public VisualScript.Metadata Meta { get; }
Property Value
VisualScript.Metadata
|
Parameters
Gets the list of Visual Script parameters declared in this graph (excluding base types).
Declaration
[Unmanaged]
public VisjectGraphParameter[] Parameters { get; }
Property Value
VisjectGraphParameter[]
|
ScriptTypeName
Gets the typename of the Visual Script. Identifies it's scripting type.
Declaration
[Unmanaged]
public string ScriptTypeName { get; }
Property Value
System.String
|
Methods
CreateInstance()
Creates a new instance of the Visual Script object.
Declaration
[Unmanaged]
public Object CreateInstance()
Returns
Object
The created instance or null if failed. |
GetMetaData(Int32)
Gets the metadata of the script surface.
Declaration
[Unmanaged]
public byte[] GetMetaData(int typeID)
Parameters
System.Int32
typeID
|
Returns
System.Byte[]
|
GetMethodMetaData(Int32, Int32)
Gets the metadata of the method.
Declaration
[Unmanaged]
public byte[] GetMethodMetaData(int index, int typeID)
Parameters
System.Int32
index
|
System.Int32
typeID
|
Returns
System.Byte[]
|
GetMethodsCount()
Returns the amount of methods in the script.
Declaration
[Unmanaged]
public int GetMethodsCount()
Returns
System.Int32
|
GetMethodSignature(Int32, out String, out Byte, out String, out String[], out String[], out Boolean[])
Gets the signature data of the method.
Declaration
[Unmanaged]
public void GetMethodSignature(int index, out string name, out byte flags, out string returnTypeName, out string[] paramNames, out string[] paramTypeNames, out bool[] paramOuts)
Parameters
System.Int32
index
|
System.String
name
|
System.Byte
flags
|
System.String
returnTypeName
|
System.String[]
paramNames
|
System.String[]
paramTypeNames
|
System.Boolean[]
paramOuts
|
GetScriptInstanceParameterValue(String, Object)
Gets the value of the Visual Script parameter of the given instance.
Declaration
[Unmanaged]
public object GetScriptInstanceParameterValue(string name, Object instance)
Parameters
System.String
name
The parameter name. |
Object
instance
The object instance. |
Returns
System.Object
The property value. |
LoadSurface()
Tries to load surface graph from the asset.
Declaration
[Unmanaged]
public byte[] LoadSurface()
Returns
System.Byte[]
The surface data or empty if failed to load it. |
SaveSurface(Byte[], ref VisualScript.Metadata)
Updates the graph surface (save new one, discard cached data, reload asset).
Declaration
[Unmanaged]
public bool SaveSurface(byte[] data, ref VisualScript.Metadata meta)
Parameters
System.Byte[]
data
Stream with graph data. |
VisualScript.Metadata
meta
Script metadata. |
Returns
System.Boolean
True if cannot save it, otherwise false. |
SetScriptInstanceParameterValue(String, Object, Object)
Sets the value of the Visual Script parameter of the given instance.
Declaration
[Unmanaged]
public void SetScriptInstanceParameterValue(string name, Object instance, object value)
Parameters
System.String
name
The parameter name. |
Object
instance
The object instance. |
System.Object
value
The property value to set. |