Breakroom is now Sinewave Campus. Book a meeting

SScriptingResources

ClientComposants
Dans cette classeGetResource
  1. Fonctions
  2. GetResource
  3. Propriétés
  4. Enabled
  5. Resources
  6. GameObject
Membres 4
FonctionGetResourceReturns the SResource with the specified name, or else returns nil if not found.
PropriétéEnabledReturn whether the ScriptingResources component is Enabled or not
PropriétéResourcesReturns an array of all resources contained within this component.
PropriétéGameObject–

Fonctions​

GetResource​

SResource GetResource(string name)

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

Paramètres

NomTypeValeur par défaut
namestring–

Valeurs de retour

SResource

Exemple

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

Propriétés​

Enabled​

bool Enabled {get; set; }

Return whether the ScriptingResources component is Enabled or not

Exemple

Lua
Space.Host.ExecutingObject.Resources.Enabled = true

ResourcesLecture seule​

SResource[] Resources {get; }

Returns an array of all resources contained within this component.

Exemple

Lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources

GameObjectLecture seule​

SGameObject GameObject {get; }

Exemple

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