SScriptingData
ClientComponents
On this classGetVariable
- Functions
- Get
Variable - Set
Variable - Properties
- Enabled
- Variables
- Component
Name - Game
Object
Members 6
| Function | GetVariable | Return the object of the variable. |
| Function | SetVariable | Set properties to variable. |
| Property | Enabled | Is the ScriptingData component Enabled? |
| Property | Variables | – |
| Property | ComponentName | The name of this component. |
| Property | GameObject | – |
Functions
GetVariable
object GetVariable(string name)
Return the object of the variable.
Parameters
| Name | Type | Default |
|---|---|---|
| name | string | – |
Returns
object
Example
Lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")
SetVariable
void SetVariable(string name, DynValue property, bool persistent = false)
Set properties to variable.
Parameters
| Name | Type | Default |
|---|---|---|
| name | string | – |
| property | DynValue | – |
| persistent | bool | false |
Returns
void
Example
Lua
Space.Host.ExecutingObject.SetVariable("variableName",5,true)
Properties
Enabled
bool Enabled {get; set; }
Is the ScriptingData component Enabled?
Example
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)
VariablesRead only
string[] Variables {get; }
Example
Lua
variableNames = Space.Host.ExecutingObject.Data.Variables
ComponentNameRead only
string ComponentName {get; }
The name of this component.
Example
Lua
componentName = Space.Host.ExecutingObject.Data.ComponentName
GameObjectRead only
Example
Lua
theGameObject = Space.Host.ExecutingObject.Data.GameObject



