SScriptingData
Index
Functions Index
| Function Name |
|---|
| object GetVariable (string name) |
| void SetVariable (string name, DynValue property, bool persistent=false) |
Properties Index
| Property Name |
|---|
bool Enabled get set |
string[] Variables get |
string ComponentName get |
SGameObject GameObject get |
Functions
GetVariable
object GetVariable (string name)
Return the object of the variable.
| Parameter | Type | Description |
|---|---|---|
- Lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")
SetVariable
void SetVariable (string name, DynValue property, bool persistent=false)
Set properties to variable.
| Parameter | Type | Description |
|---|---|---|
- Lua
Space.Host.ExecutingObject.SetVariable("variableName",5,true)
Properties
Enabled
bool Enabled get set
Is the ScriptingData component Enabled?
- 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)
Variables
string[] Variables get
Property Description
- Lua
variableNames = Space.Host.ExecutingObject.Data.Variables
ComponentName
string ComponentName get
The name of this component.
- Lua
componentName = Space.Host.ExecutingObject.Data.ComponentName
GameObject
SGameObject GameObject get
Property Description
- Lua
theGameObject = Space.Host.ExecutingObject.Data.GameObject