Breakroom is now Sinewave Campus. Book a meeting

SScriptingRuntime

ClientComposants
Dans cette classeGetResource
  1. Fonctions
  2. GetResource
  3. CallScriptFunction
  4. Reset
  5. GetPublicVariable
  6. SetPublicVariable
  7. InvokeEvent
  8. Propriétés
  9. Resources
  10. Enabled
  11. ComponentName
  12. GameObject
Membres 10
FonctionGetResourceGet the resource by its name and return it.
FonctionCallScriptFunctionCall registered script function with specified arguments.
FonctionResetReset event members to their initial values.
FonctionGetPublicVariableGets the public variable by its name and return it.
FonctionSetPublicVariableSet the property to public variable with name "name".
FonctionInvokeEventInvokes the event with the name "name".
PropriétéResourcesReturn a list of resource.
PropriétéEnabledWhether the scripting runtime component is Enabled.
PropriétéComponentNameThe name of this component.
PropriétéGameObject–

Fonctions​

GetResource​

SResource GetResource(string name)

Get the resource by its name and return it.

Paramètres

NomTypeValeur par défaut
namestring–

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

NomTypeValeur par défaut
namestring–
argumentsparams 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

NomTypeValeur par défaut
namestring–

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

NomTypeValeur par défaut
namestring–
propertyDynValue–
persistentboolfalse

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

NomTypeValeur par défaut
namestring–

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Script.InvokeEvent("EventName")

Propriétés​

ResourcesLecture seule​

SResource[] Resources {get; }

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​

SGameObject GameObject {get; }

Exemple

Lua
theGameObject = Space.Host.ExecutingObject.Script.GameObject