Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SScriptingData Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SScriptingData:
ScriptClassComponent< ScriptingDataBaseInternal >

Public Member Functions

object GetVariable (string name)
 Return the object of the variable. More...
 
void SetVariable (string name, DynValue property, bool persistent=false)
 Set the "property" to variable More...
 

Properties

bool Enabled [get, set]
 Return whether the ScriptingData component is Enabled or not More...
 
string ComponentName [get]
 Return the component name of the scripting data More...
 
string[] Variables [get]
 This return a list of variables More...
 
- Properties inherited from ScriptClassComponent< ScriptingDataBaseInternal >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ GetVariable()

object SineSpace.Scripting.Components.SScriptingData.GetVariable ( string  name)

Return the object of the variable.

local thisObject=Space.Host.ExecutingObject
local thisObjectVariable=thisObject.Data.Variables
for i=1, #thisObjectVariable do
Space.Log(thisObjectVariable[i])
end
Parameters
nameThe name of variable

◆ SetVariable()

void SineSpace.Scripting.Components.SScriptingData.SetVariable ( string  name,
DynValue  property,
bool  persistent = false 
)

Set the "property" to variable

local thisObject=Space.Host.ExecutingObject
thisObjectData.SetVariable(no1Name,"no1",false)
Space.Log(no1)
&ndash;Set "no1" to "no1"
Parameters
name
propertyThe value in a lua/MoonSharp script
persistent

Property Documentation

◆ ComponentName

string SineSpace.Scripting.Components.SScriptingData.ComponentName
get

Return the component name of the scripting data

local thisObject=Space.Host.ExecutingObject
local data=thisObject.Data
Space.Log(data.ComponentName)

◆ Enabled

bool SineSpace.Scripting.Components.SScriptingData.Enabled
getset

Return whether the ScriptingData component is Enabled or not

local thisObject=Space.Host.ExecutingObject
local thisObjectData=thisObject.Data
Space.Log(thisObjectData.Enabled)

◆ Variables

string [] SineSpace.Scripting.Components.SScriptingData.Variables
get

This return a list of variables

local thisObject=Space.Host.ExecutingObject
local thisObjectVariable=thisObject.Data.Variables
for i=1, #thisObjectVariable do
Space.Log(thisObjectVariable[i])
end