SScriptingResources
ClientComposants
Dans cette classeGetResource
- Fonctions
- Get
Resource - Propriétés
- Enabled
- Resources
- Game
Object
Membres 4
| Fonction | GetResource | Returns the SResource with the specified name, or else returns nil if not found. |
| Propriété | Enabled | Return whether the ScriptingResources component is Enabled or not |
| Propriété | Resources | Returns an array of all resources contained within this component. |
| Propriété | GameObject | – |
Fonctions
GetResource
Returns the SResource with the specified name, or else returns nil if not found.
Paramètres
| Nom | Type | Valeur par défaut |
|---|---|---|
| name | string | – |
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
Exemple
Lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject



