SScriptingResources
ClientComponents
On this classGetResource
- Functions
- Get
Resource - Properties
- Enabled
- Resources
- Game
Object
Members 4
| Function | GetResource | Returns the SResource with the specified name, or else returns nil if not found. |
| Property | Enabled | Return whether the ScriptingResources component is Enabled or not |
| Property | Resources | Returns an array of all resources contained within this component. |
| Property | GameObject | – |
Functions
GetResource
Returns the SResource with the specified name, or else returns nil if not found.
Parameters
| Name | Type | Default |
|---|---|---|
| name | string | – |
Returns
SResource
Example
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
Properties
Enabled
bool Enabled {get; set; }
Return whether the ScriptingResources component is Enabled or not
Example
Lua
Space.Host.ExecutingObject.Resources.Enabled = true
ResourcesRead only
SResource[] Resources {get; }
Returns an array of all resources contained within this component.
Example
Lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources
GameObjectRead only
Example
Lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject



