C# Class LeopotamGroup.Scripting.ScriptVM

Script engine VM. Internal class.
Datei anzeigen Open project: Leopotam/LeopotamGroupLibraryUnity Class Usage Examples

Public Methods

Method Description
CallFunction ( string funcName, ScriptVar &result, ScriptVar param1 = null, ScriptVar param2 = null, ScriptVar param3 = null, ScriptVar param4 = null ) : string

Call script function.

GetParamByID ( int id ) : ScriptVar

Get specified parameter that was passed from script to current host function.

GetParamsCount ( ) : int

Get parameters count passed from script to current host function.

IsFunctionExists ( string funcName ) : bool

Is script function exists.

Load ( string source ) : string

Load script source code. Old Vm state will be reset.

RegisterHostFunction ( string funcName, HostFunction cb ) : void

Register host function to VM (publish to calling from script side).

ScriptVM ( ) : LeopotamGroup.Scripting.Internal

Default initialization.

SetRuntimeError ( string msg ) : void

Raise runtime error at VM.

UnregisterAllHostFunctions ( ) : void

Unregister all host functions from VM (unpublish from script side).

Method Details

CallFunction() public method

Call script function.
public CallFunction ( string funcName, ScriptVar &result, ScriptVar param1 = null, ScriptVar param2 = null, ScriptVar param3 = null, ScriptVar param4 = null ) : string
funcName string Function name.
result ScriptVar Result of function execution.
param1 ScriptVar Optional parameter to function.
param2 ScriptVar Optional parameter to function.
param3 ScriptVar Optional parameter to function.
param4 ScriptVar Optional parameter to function.
return string

GetParamByID() public method

Get specified parameter that was passed from script to current host function.
public GetParamByID ( int id ) : ScriptVar
id int Number of parameter.
return ScriptVar

GetParamsCount() public method

Get parameters count passed from script to current host function.
public GetParamsCount ( ) : int
return int

IsFunctionExists() public method

Is script function exists.
public IsFunctionExists ( string funcName ) : bool
funcName string Function name.
return bool

Load() public method

Load script source code. Old Vm state will be reset.
public Load ( string source ) : string
source string Source.
return string

RegisterHostFunction() public method

Register host function to VM (publish to calling from script side).
public RegisterHostFunction ( string funcName, HostFunction cb ) : void
funcName string Func name.
cb HostFunction Cb.
return void

ScriptVM() public method

Default initialization.
public ScriptVM ( ) : LeopotamGroup.Scripting.Internal
return LeopotamGroup.Scripting.Internal

SetRuntimeError() public method

Raise runtime error at VM.
public SetRuntimeError ( string msg ) : void
msg string Message.
return void

UnregisterAllHostFunctions() public method

Unregister all host functions from VM (unpublish from script side).
public UnregisterAllHostFunctions ( ) : void
return void