SResource
العميلالأنواع
في هذا الصنفName
الأعضاء 7
| خاصية | Name | Returns the name of the resource as entered in the scripting runtime |
| خاصية | Type | Returns the type of the resource as a string |
| خاصية | AsText | Converts the resource's type from SResource type to string |
| خاصية | AsGameObject | – |
| خاصية | AsMaterial | Converts the resource's type from SResource to SMaterial |
| خاصية | TextureWidth | Returns the Texture Width of this resource |
| خاصية | TextureHeight | Returns the Texture Height of this resource |
الخصائص
Nameللقراءة فقط
string Name {get; }
Returns the name of the resource as entered in the scripting runtime
مثال
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
Typeللقراءة فقط
string Type {get; }
Returns the type of the resource as a string
مثال
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
AsTextللقراءة فقط
string AsText {get; }
Converts the resource's type from SResource type to string
مثال
Lua
Text = Space.GetResource("Resource Name").AsText
AsGameObjectللقراءة فقط
مثال
Lua
GameObject = Space.GetResource("Resource Name").AsGameObject
AsMaterialللقراءة فقط
Converts the resource's type from SResource to SMaterial
مثال
Lua
Material = Space.GetResource("Resource Name").AsMaterial
TextureWidthللقراءة فقط
float TextureWidth {get; }
Returns the Texture Width of this resource
مثال
Lua
TextureWidth = Space.GetResource("Resource Name").TextureWidth
TextureHeightللقراءة فقط
float TextureHeight {get; }
Returns the Texture Height of this resource
مثال
Lua
TextureHeight = Space.GetResource("Resource Name").TextureHeight



