wiki.sine.space | sinespace

Scripting/ScriptingEvents

From wiki.sine.space
Revision as of 04:07, 28 December 2020 by Edisonwu (Talk | contribs) (Created page with "=Properties= {{ScriptFunction|bool|Enabled|{get;set;}|Return whether the scripting events component is enabled.|5= local thisObject=Space.Host.ExecutingObject<br> local thisO...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Properties

Enabled

bool Enabled {get;set;}

Return whether the scripting events component is enabled.

local thisObject=Space.Host.ExecutingObject

local thisObjectScriptingEvents=thisObject.Events
Space.Log(thisObjectScriptingEvents.Enabled)

--print true.


Events

string Events {get;}

Returns a list of events.

local thisObject=Space.Host.ExecutingObject

local events=thisObject.Events.Events
--return a list of Objects.
for i=1, #events do
    Space.Log(events[i])
end

--display the name of all events.


Events

string Events {get;}

Invoke an event with its name.

local thisObject=Space.Host.ExecutingObject

local no1Name="no1"
thisObject.Events.InvokeEvent(no1Name)

--invoke the“no1”event..