Skip to main content

Behaviour

info

Behaviour inherits from Component

Behaviours are Components that can be enabled or disabled.

Members

Properties

NameDescription
Behaviour.enabledEnabled Behaviours are Updated, disabled Behaviours are not.
Behaviour.isActiveAndEnabledHas the Behaviour had active and enabled called?

Inherited Members

Inherited Properties

NameDescription
Behaviour.gameObjectThe game object this component is attached to. A component is always attached to a game object.
Behaviour.tagThe tag of this game object.
Behaviour.transformThe Transform attached to this GameObject.
Behaviour.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
Behaviour.nameThe name of the object.

Inherited Methods

NameDescription
Behaviour.BroadcastMessage(methodName, parameter=nil)Calls the method named methodName on every Lua Script in this game object or any of its children.
Behaviour.CompareTag(tag)Is this game object tagged with tag ?
Behaviour.GetAllLuaScripts()Returns an array of all Lua scripts that attached to the game object.
Behaviour.GetComponent(type)Returns the component of Type type if the game object has one attached, nil if it doesn't.
Behaviour.GetComponentInChildren(t)Returns the component of Type type in the GameObject or any of its children using depth first search.
Behaviour.GetComponentInParent(t)Returns the component of Type type in the GameObject or any of its parents.
Behaviour.GetComponents(type)Returns all components of Type type in the GameObject.
Behaviour.GetComponentsInChildren(t)Returns all components of Type type in the GameObject or any of its children.
Behaviour.GetComponentsInParent(t)Returns all components of Type type in the GameObject or any of its parents.
Behaviour.SendMessage(methodName, value=nil)Calls the method named methodName on every Lua Script in this game object.
Behaviour.SendMessageUpwards(methodName, value=nil)Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
Behaviour.TryGetComponent(type)Gets the component of the specified type, if it exists.
Behaviour.GetInstanceID()Returns the instance id of the object.