SResource
ClientTypes
Dans cette classeName
Membres 7
| Propriété | Name | Returns the name of the resource as entered in the scripting runtime |
| Propriété | Type | Returns the type of the resource as a string |
| Propriété | AsText | Converts the resource's type from SResource type to string |
| Propriété | AsGameObject | – |
| Propriété | AsMaterial | Converts the resource's type from SResource to SMaterial |
| Propriété | TextureWidth | Returns the Texture Width of this resource |
| Propriété | TextureHeight | Returns the Texture Height of this resource |
Propriétés
NameLecture seule
string Name {get; }
Returns the name of the resource as entered in the scripting runtime
Exemple
Lua
ResourceName = Space.Resources[1].Name
Lua
--the below script will search through the Scripting Runtime's resources
--and return the first instance of an Animation Clip
--[You need to add a few resources to the scripting runtime and make one of them an animation]
resources = Space.Resources
for i = 1, #resources do
if resources[i].Type == "AnimationClip" then
Space.Log("Resource #".. i .. " is an Animation Clip. The resource name is: " .. resources[i].Name)
break
end
end
TypeLecture seule
string Type {get; }
Returns the type of the resource as a string
Exemple
Lua
ResourceType = Space.GetResource("Resource Name").Type
Lua
--the below script will search through the Scripting Runtime's resources
--and return the first instance of an Animation Clip
--[You need to add a few resources to the scripting runtime and make one of them an animation]
resources = Space.Resources
for i = 1, #resources do
if resources[i].Type == "AnimationClip" then
Space.Log("Resource #".. i .. " is an Animation Clip. The resource name is: " .. resources[i].Name)
break
end
end
AsTextLecture seule
string AsText {get; }
Converts the resource's type from SResource type to string
Exemple
Lua
Text = Space.GetResource("Resource Name").AsText
AsGameObjectLecture seule
Exemple
Lua
GameObject = Space.GetResource("Resource Name").AsGameObject
AsMaterialLecture seule
Converts the resource's type from SResource to SMaterial
Exemple
Lua
Material = Space.GetResource("Resource Name").AsMaterial
TextureWidthLecture seule
float TextureWidth {get; }
Returns the Texture Width of this resource
Exemple
Lua
TextureWidth = Space.GetResource("Resource Name").TextureWidth
TextureHeightLecture seule
float TextureHeight {get; }
Returns the Texture Height of this resource
Exemple
Lua
TextureHeight = Space.GetResource("Resource Name").TextureHeight



