Breakroom is now Sinewave Campus. Book a meeting

SResource

ClientTypes
Dans cette classeName
  1. Propriétés
  2. Name
  3. Type
  4. AsText
  5. AsGameObject
  6. AsMaterial
  7. TextureWidth
  8. TextureHeight
Membres 7
PropriétéNameReturns the name of the resource as entered in the scripting runtime
PropriétéTypeReturns the type of the resource as a string
PropriétéAsTextConverts the resource's type from SResource type to string
PropriétéAsGameObject–
PropriétéAsMaterialConverts the resource's type from SResource to SMaterial
PropriétéTextureWidthReturns the Texture Width of this resource
PropriétéTextureHeightReturns 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​

SGameObject AsGameObject {get; }

Exemple

Lua
GameObject = Space.GetResource("Resource Name").AsGameObject

AsMaterialLecture seule​

SMaterial AsMaterial {get; }

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