Get the resource by its name and return it.
local scripts=thisObject.Script
local getRes=scripts.GetResource("Cube (2)")
Space.Log(getRes.Name)
Call registered script function with specified arguments.
scripts.CallScriptFunction("Fun","Hello Lua!")
function Fun(a)
Space.Log(a)
end
Call registered script function.
local scripts=thisObject.Script
scripts.CallScriptFunction("Fun")
function Fun()
local a="Hello Lua!"
Space.Log(a)
end
Reset event members to their initial values.
local scripts=thisObject.Script
scripts.CallScriptFunction("Fun")
function Reset()
scripts.Reset()
end
function Fun()
local a="Hello Lua!"
Space.Log(a)
Gets the public variable by its name and return it.
local scripts=thisObject.Script
local publicVariabl = scripts.GetPublicVariable("no1")
Set the property to public variable with name "name".
local scripts=thisObject.Script
scripts.SetPublicVariable("no1","var1",false)
local publicVariabl = scripts.GetPublicVariable("no1")
Space.Log(publicVariabl)
Invokes the event with the name "name".
local scripts=thisObject.Script
scripts.InvokeEvent("event1")
function Fun()
a="Hello Lua!"
Space.Log(a)
end
Return a list of resource.
local scripts=thisObject.Script
local resources=scripts.Resources
for i = 0, #resources-1 do
Space.Log(resources[i].Name)
end
Whether the scripting runtime component is Enabled.
local scripts=thisObject.Script
Space.Log(scripts.Enabled)
|