Breakroom is now Sinewave Campus. Book a meeting

SScriptingResources

العميلالمكونات
في هذا الصنفGetResource
  1. الدوال
  2. GetResource
  3. الخصائص
  4. Enabled
  5. Resources
  6. GameObject
الأعضاء 4
دالةGetResourceReturns the SResource with the specified name, or else returns nil if not found.
خاصيةEnabledReturn whether the ScriptingResources component is Enabled or not
خاصيةResourcesReturns an array of all resources contained within this component.
خاصيةGameObject–

الدوال​

GetResource​

SResource GetResource(string name)

Returns the SResource with the specified name, or else returns nil if not found.

المعاملات

الاسمالنوعالقيمة الافتراضية
namestring–

القيم المرجعة

SResource

مثال

Lua
resource = Space.Host.ExecutingObject.Resources.GetResource("ResourceName")
Lua
local thisObject=Space.Host.ExecutingObject
local thisObjectResource=thisObject.Resources.GetResource("Test")
if thisObjectResource == nil then
Space.Log("That resource was not found.")
else
Space.Log("That resource exists and can be used.")
end

الخصائص​

Enabled​

bool Enabled {get; set; }

Return whether the ScriptingResources component is Enabled or not

مثال

Lua
Space.Host.ExecutingObject.Resources.Enabled = true

Resourcesللقراءة فقط​

SResource[] Resources {get; }

Returns an array of all resources contained within this component.

مثال

Lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources

GameObjectللقراءة فقط​

SGameObject GameObject {get; }

مثال

Lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject