SScriptingResources
客户端组件
在此类中GetResource
成员 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



