All pages
Powered by GitBook
1 of 1

Loading...

SResource

Index

Properties Index

Property

Properties

Name

string Name get

Returns the name of the resource as entered in the scripting runtime

Type

string Type get

Returns the type of the resource as a string

AsText

string AsText get

Converts the resource's type from SResource type to string

AsGameObject

AsGameObject get

Property Description

AsMaterial

AsMaterial get

Converts the resource's type from SResource to SMaterial

TextureWidth

float TextureWidth get

Returns the Texture Width of this resource

TextureHeight

float TextureHeight get

Returns the Texture Height of this resource

string Name get

string Type get

string AsText get

SGameObject AsGameObject get

SMaterial AsMaterial get

float TextureWidth get

float TextureHeight get

SGameObject
SMaterial
ResourceName = Space.Resources[1].Name
--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
ResourceType = Space.GetResource("Resource Name").Type
--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
Text = Space.GetResource("Resource Name").AsText
GameObject = Space.GetResource("Resource Name").AsGameObject
Material = Space.GetResource("Resource Name").AsMaterial
TextureWidth = Space.GetResource("Resource Name").TextureWidth
TextureHeight = Space.GetResource("Resource Name").TextureHeight