SResource
ClientTypes
On this className
Members 7
| Property | Name | Returns the name of the resource as entered in the scripting runtime |
| Property | Type | Returns the type of the resource as a string |
| Property | AsText | Converts the resource's type from SResource type to string |
| Property | AsGameObject | – |
| Property | AsMaterial | Converts the resource's type from SResource to SMaterial |
| Property | TextureWidth | Returns the Texture Width of this resource |
| Property | TextureHeight | Returns the Texture Height of this resource |
Properties
NameRead only
string Name {get; }
Returns the name of the resource as entered in the scripting runtime
Example
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
TypeRead only
string Type {get; }
Returns the type of the resource as a string
Example
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
AsTextRead only
string AsText {get; }
Converts the resource's type from SResource type to string
Example
Lua
Text = Space.GetResource("Resource Name").AsText
AsGameObjectRead only
Example
Lua
GameObject = Space.GetResource("Resource Name").AsGameObject
AsMaterialRead only
Converts the resource's type from SResource to SMaterial
Example
Lua
Material = Space.GetResource("Resource Name").AsMaterial
TextureWidthRead only
float TextureWidth {get; }
Returns the Texture Width of this resource
Example
Lua
TextureWidth = Space.GetResource("Resource Name").TextureWidth
TextureHeightRead only
float TextureHeight {get; }
Returns the Texture Height of this resource
Example
Lua
TextureHeight = Space.GetResource("Resource Name").TextureHeight



