SScriptingRuntime
ClientComposants
Dans cette classeGetResource
Membres 10
| Fonction | GetResource | Get the resource by its name and return it. |
| Fonction | CallScriptFunction | Call registered script function with specified arguments. |
| Fonction | Reset | Reset event members to their initial values. |
| Fonction | GetPublicVariable | Gets the public variable by its name and return it. |
| Fonction | SetPublicVariable | Set the property to public variable with name "name". |
| Fonction | InvokeEvent | Invokes the event with the name "name". |
| Propriété | Resources | Return a list of resource. |
| Propriété | Enabled | Whether the scripting runtime component is Enabled. |
| Propriété | ComponentName | The name of this component. |
| Propriété | GameObject | – |
Fonctions
GetResource
Get the resource by its name and return it.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
SResource
Exemple
Lua
resource = Space.Host.ExecutingObject.Script.GetResource("resource name")
CallScriptFunction
void CallScriptFunction(string name, params DynValue[] arguments)
void CallScriptFunction(string name)
Call registered script function with specified arguments.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| arguments | params DynValue[] | – |
Valeurs de retour
void
Exemple
Lua
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName")
--or
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName", tableWithArguments)
Reset
void Reset()
Reset event members to their initial values.
Valeurs de retour
void
Exemple
Lua
Space.Host.ExecutingObject.Script.Reset()
GetPublicVariable
object GetPublicVariable(string name)
Gets the public variable by its name and return it.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
object
Exemple
Lua
publicVariable = Space.Host.ExecutingObject.Script.GetPublicVariable("variableName")
SetPublicVariable
void SetPublicVariable(string name, DynValue property, bool persistent = false)
Set the property to public variable with name "name".
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| property | DynValue | – |
| persistent | bool | false |
Valeurs de retour
void
Exemple
Lua
Space.Host.ExecutingObject.Script.SetPublicVariable("VariableName",5,true)
InvokeEvent
void InvokeEvent(string name)
Invokes the event with the name "name".
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
Valeurs de retour
void
Exemple
Lua
Space.Host.ExecutingObject.Script.InvokeEvent("EventName")
Propriétés
ResourcesLecture seule
Return a list of resource.
Exemple
Lua
tableResources = Space.Host.ExecutingObject.Script.Resources
Enabled
bool Enabled {get; set; }
Whether the scripting runtime component is Enabled.
Exemple
Lua
Space.Host.ExecutingObject.Script.Enabled = true
ComponentNameLecture seule
string ComponentName {get; }
The name of this component.
Exemple
Lua
componentName = Space.Host.ExecutingObject.Script.ComponentName
GameObjectLecture seule
Exemple
Lua
theGameObject = Space.Host.ExecutingObject.Script.GameObject



