SScriptingData
العميلالمكونات
في هذا الصنفGetVariable
الأعضاء 6
| دالة | GetVariable | Return the object of the variable. |
| دالة | SetVariable | Set properties to variable. |
| خاصية | Enabled | Is the ScriptingData component Enabled? |
| خاصية | Variables | – |
| خاصية | ComponentName | The name of this component. |
| خاصية | GameObject | – |
الدوال
GetVariable
object GetVariable(string name)
Return the object of the variable.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
object
مثال
Lua
Space.Host.ExecutingObject.Data.GetVariable("variableName")
SetVariable
void SetVariable(string name, DynValue property, bool persistent = false)
Set properties to variable.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| property | DynValue | – |
| persistent | bool | false |
القيم المرجعة
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للقراءة فقط
مثال
Lua
theGameObject = Space.Host.ExecutingObject.Data.GameObject



