Behaviour
The Behaviour class represents a fundamental component within the scene graph system, serving as a container for properties and behaviors associated with nodes in the scene
Usage
This class is implicity included in every scripts, no require necessary.
Reference
getByNodeId
Get all behaviours attached to a specific node ID.
Parameters
nodeId(string): The ID of the scene graph node
Returns
table: table containing all behaviours attached to the node
getByNodeIdAndScriptName
Get a single behaviour attached to a node ID with a specific script name.
Parameters
nodeId(string): The ID of the scene graph nodescriptName(string): The script name of the behaviour
Returns
Behaviour|nil: behaviour if found, or nil
getNodeId
Returns the node ID this Behaviour is attached to.
Returns
string|nil: ID of the attached scene object
getScriptName
Returns the script name of this Behaviour.
Returns
string: name
getProperties
Returns a table of all properties defined on the behaviour class.
Returns
table: table with fields: name, defaultValue, type, order
isActive
Returns the active state of the behaviour. If the owner item is inactive, so are all attached behaviours
Returns
boolean: if active, othersise false
isInitialized
Returns the initialized state of the behaviour. If true, init ran through or there is no init
Returns
boolean: if initialized, othersise false
init
ondisable
onenable
ondestroy
updateAll
Parameters
deltaTimedeltaTimeSmooth
renderAll
renderguiAll
setActive
Parameters
nodes