Skip to main content

GameObject Events

Extension Tools for Unity makes it easier than ever to listen to events. Adding a callback to an event is done using the event listener like this:

using ExtensionsTools;

...

gameObject.GetEventListener().OnEnabled += OnEnableCallback;

Here is a list of all possible events:

Event
OnNameChange
OnTagChange
OnLayerMaskChange
OnIsStaticChange
OnDisabled
OnEnabled
OnDestroyed
OnAddComponent
OnDestroyComponent
OnReparent
OnTransform
OnMove
OnRotate
OnScale
OnCollisionEntered
OnCollisionStayed
OnCollisionExited
OnTriggerEntered
OnTriggerStayed
OnTriggerExited
OnCollision2DEntered
OnCollision2DStayed
OnCollision2DExited
OnTrigger2DEntered
OnTrigger2DStayed
OnTrigger2DExited