Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SScriptingResources Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SScriptingResources:
ScriptClassComponent< ScriptingResourcesBaseInternal >

Public Member Functions

SResource GetResource (string name)
 Returns the SResource with the specified name, or else returns nil if not found. More...
 

Properties

bool Enabled [get, set]
 Return whether the ScriptingResources component is Enabled or not More...
 
SResource[] Resources [get]
 Returns an array of all resources contained within this component. More...
 
- Properties inherited from ScriptClassComponent< ScriptingResourcesBaseInternal >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ GetResource()

SResource SineSpace.Scripting.Components.SScriptingResources.GetResource ( string  name)

Returns the SResource with the specified name, or else returns nil if not found.

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
Parameters
nameThe name of the resource

Property Documentation

◆ Enabled

bool SineSpace.Scripting.Components.SScriptingResources.Enabled
getset

Return whether the ScriptingResources component is Enabled or not

local thisObject=Space.Host.ExecutingObject
local thisObjectResources=thisObject.Resources
Space.Log(thisObjectResources.Enabled)

◆ Resources

SResource [] SineSpace.Scripting.Components.SScriptingResources.Resources
get

Returns an array of all resources contained within this component.

local thisObject=Space.Host.ExecutingObject
local thisObjectResources=thisObject.Resources.Resources
for i=1, #thisObjectResources do
Space.Log(thisObjectResources[i].Name)
end