SScriptingData
ClientComposants
Dans cette classeGetVariable
- Fonctions
- Get
Variable - Set
Variable - Propriétés
- Enabled
- Variables
- Component
Name - Game
Object
Membres 6
| Fonction | GetVariable | Return the object of the variable. |
| Fonction | SetVariable | Set properties to variable. |
| Propriété | Enabled | Is the ScriptingData component Enabled? |
| Propriété | Variables | – |
| Propriété | ComponentName | The name of this component. |
| Propriété | GameObject | – |
Fonctions
GetVariable
object GetVariable(string name)
Return the object of the variable.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
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
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
| property | DynValue | – |
| persistent | bool | false |
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
Exemple
Lua
theGameObject = Space.Host.ExecutingObject.Data.GameObject



