SScriptingResources
العميلالمكونات
في هذا الصنفGetResource
- الدوال
- Get
Resource - الخصائص
- Enabled
- Resources
- Game
Object
الأعضاء 4
| دالة | GetResource | Returns the SResource with the specified name, or else returns nil if not found. |
| خاصية | Enabled | Return whether the ScriptingResources component is Enabled or not |
| خاصية | Resources | Returns an array of all resources contained within this component. |
| خاصية | GameObject | – |
الدوال
GetResource
Returns the SResource with the specified name, or else returns nil if not found.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| name | string | – |
القيم المرجعة
SResource
مثال
Lua
resource = Space.Host.ExecutingObject.Resources.GetResource("ResourceName")
Lua
local thisObject=Space.Host.ExecutingObject
local thisObjectResource=thisObject.Resources.GetResource("Test")
if thisObjectResource == nil then
Space.Log("That resource was not found.")
else
Space.Log("That resource exists and can be used.")
end
الخصائص
Enabled
bool Enabled {get; set; }
Return whether the ScriptingResources component is Enabled or not
مثال
Lua
Space.Host.ExecutingObject.Resources.Enabled = true
Resourcesللقراءة فقط
SResource[] Resources {get; }
Returns an array of all resources contained within this component.
مثال
Lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources
GameObjectللقراءة فقط
مثال
Lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject



