C# Class LeopotamGroup.Scripting.ScriptVM

Script engine VM. Internal class.
Afficher le fichier Open project: Leopotam/LeopotamGroupLibraryUnity Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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.
Résultat string

GetParamByID() public méthode

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

GetParamsCount() public méthode

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

IsFunctionExists() public méthode

Is script function exists.
public IsFunctionExists ( string funcName ) : bool
funcName string Function name.
Résultat bool

Load() public méthode

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

RegisterHostFunction() public méthode

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.
Résultat void

ScriptVM() public méthode

Default initialization.
public ScriptVM ( ) : LeopotamGroup.Scripting.Internal
Résultat LeopotamGroup.Scripting.Internal

SetRuntimeError() public méthode

Raise runtime error at VM.
public SetRuntimeError ( string msg ) : void
msg string Message.
Résultat void

UnregisterAllHostFunctions() public méthode

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