Breakroom is now Sinewave Campus. Book a meeting

SScriptingResources

ClientComponents
On this classGetResource
  1. Functions
  2. GetResource
  3. Properties
  4. Enabled
  5. Resources
  6. GameObject
Members 4
FunctionGetResourceReturns the SResource with the specified name, or else returns nil if not found.
PropertyEnabledReturn whether the ScriptingResources component is Enabled or not
PropertyResourcesReturns an array of all resources contained within this component.
PropertyGameObject–

Functions​

GetResource​

SResource GetResource(string name)

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

Parameters

NameTypeDefault
namestring–

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​

SGameObject GameObject {get; }

Example

Lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject