Breakroom is now Sinewave Campus. Book a meeting

SScriptingData

ClientComposants
Dans cette classeGetVariable
  1. Fonctions
  2. GetVariable
  3. SetVariable
  4. Propriétés
  5. Enabled
  6. Variables
  7. ComponentName
  8. GameObject
Membres 6
FonctionGetVariableReturn the object of the variable.
FonctionSetVariableSet properties to variable.
PropriétéEnabledIs the ScriptingData component Enabled?
PropriétéVariables–
PropriétéComponentNameThe name of this component.
PropriétéGameObject–

Fonctions​

GetVariable​

object GetVariable(string name)

Return the object of the variable.

Paramètres

NomTypeValeur par défaut
namestring–

Valeurs de retour

object

Exemple

Lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")

SetVariable​

void SetVariable(string name, DynValue property, bool persistent = false)

Set properties to variable.

Paramètres

NomTypeValeur par défaut
namestring–
propertyDynValue–
persistentboolfalse

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.SetVariable("variableName",5,true)

Propriétés​

Enabled​

bool Enabled {get; set; }

Is the ScriptingData component Enabled?

Exemple

Lua
Space.Host.ExecutingObject.Data.Enabled = false
Lua
--clicking this object will Enable/Disable it's Scripting Data component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Data

OnClick = function()
component.Enabled = not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

VariablesLecture seule​

string[] Variables {get; }

Exemple

Lua
variableNames = Space.Host.ExecutingObject.Data.Variables

ComponentNameLecture seule​

string ComponentName {get; }

The name of this component.

Exemple

Lua
componentName = Space.Host.ExecutingObject.Data.ComponentName

GameObjectLecture seule​

SGameObject GameObject {get; }

Exemple

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