SScriptingRuntime
العميلالمكونات
في هذا الصنفGetResource
الأعضاء 10
| دالة | GetResource | Get the resource by its name and return it. |
| دالة | CallScriptFunction | Call registered script function with specified arguments. |
| دالة | Reset | Reset event members to their initial values. |
| دالة | GetPublicVariable | Gets the public variable by its name and return it. |
| دالة | SetPublicVariable | Set the property to public variable with name "name". |
| دالة | InvokeEvent | Invokes the event with the name "name". |
| خاصية | Resources | Return a list of resource. |
| خاصية | Enabled | Whether the scripting runtime component is Enabled. |
| خاصية | ComponentName | The name of this component. |
| خاصية | GameObject | – |
الدوال
GetResource
Get the resource by its name and return it.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SResource
مثال
Lua
resource = Space.Host.ExecutingObject.Script.GetResource("resource name")
CallScriptFunction
void CallScriptFunction(string name, params DynValue[] arguments)
void CallScriptFunction(string name)
Call registered script function with specified arguments.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| arguments | params DynValue[] | – |
القيم المرجعة
void
مثال
Lua
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName")
--or
resource = Space.Host.ExecutingObject.Script.CallScriptFunction("FunctionName", tableWithArguments)
Reset
void Reset()
Reset event members to their initial values.
القيم المرجعة
void
مثال
Lua
Space.Host.ExecutingObject.Script.Reset()
GetPublicVariable
object GetPublicVariable(string name)
Gets the public variable by its name and return it.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
object
مثال
Lua
publicVariable = Space.Host.ExecutingObject.Script.GetPublicVariable("variableName")
SetPublicVariable
void SetPublicVariable(string name, DynValue property, bool persistent = false)
Set the property to public variable with name "name".
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
| property | DynValue | – |
| persistent | bool | false |
القيم المرجعة
void
مثال
Lua
Space.Host.ExecutingObject.Script.SetPublicVariable("VariableName",5,true)
InvokeEvent
void InvokeEvent(string name)
Invokes the event with the name "name".
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
void
مثال
Lua
Space.Host.ExecutingObject.Script.InvokeEvent("EventName")
الخصائص
Resourcesللقراءة فقط
Return a list of resource.
مثال
Lua
tableResources = Space.Host.ExecutingObject.Script.Resources
Enabled
bool Enabled {get; set; }
Whether the scripting runtime component is Enabled.
مثال
Lua
Space.Host.ExecutingObject.Script.Enabled = true
ComponentNameللقراءة فقط
string ComponentName {get; }
The name of this component.
مثال
Lua
componentName = Space.Host.ExecutingObject.Script.ComponentName
GameObjectللقراءة فقط
مثال
Lua
theGameObject = Space.Host.ExecutingObject.Script.GameObject



