Breakroom is now Sinewave Campus. Book a meeting

SScriptingData

العميلالمكونات
في هذا الصنفGetVariable
  1. الدوال
  2. GetVariable
  3. SetVariable
  4. الخصائص
  5. Enabled
  6. Variables
  7. ComponentName
  8. GameObject
الأعضاء 6
دالةGetVariableReturn the object of the variable.
دالةSetVariableSet properties to variable.
خاصيةEnabledIs the ScriptingData component Enabled?
خاصيةVariables–
خاصيةComponentNameThe name of this component.
خاصيةGameObject–

الدوال​

GetVariable​

object GetVariable(string name)

Return the object of the variable.

المعاملات

الاسمالنوعالقيمة الافتراضية
namestring–

القيم المرجعة

object

مثال

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

SetVariable​

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

Set properties to variable.

المعاملات

الاسمالنوعالقيمة الافتراضية
namestring–
propertyDynValue–
persistentboolfalse

القيم المرجعة

void

مثال

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

الخصائص​

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; }

مثال

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; }

مثال

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