Class UIBehaviour
Base behaviour that has protected implementations of Unity lifecycle functions.
Inherited Members
Namespace: UnityEngine.EventSystems
Syntax
public abstract class UIBehaviour : MonoBehaviour
Methods
Awake()
Declaration
protected virtual void Awake()
IsActive()
Returns true if the GameObject and the Component are active.
Declaration
public virtual bool IsActive()
Returns
Type | Description |
---|---|
Boolean |
IsDestroyed()
Returns true if the native representation of the behaviour has been destroyed.
Declaration
public bool IsDestroyed()
Returns
Type | Description |
---|---|
Boolean |
Remarks
When a parent canvas is either enabled, disabled or a nested canvas's OverrideSorting is changed this function is called. You can for example use this to modify objects below a canvas that may depend on a parent canvas - for example, if a canvas is disabled you may want to halt some processing of a UI element.
OnBeforeTransformParentChanged()
Declaration
protected virtual void OnBeforeTransformParentChanged()
OnCanvasGroupChanged()
Declaration
protected virtual void OnCanvasGroupChanged()
OnCanvasHierarchyChanged()
Called when the state of the parent Canvas is changed.
Declaration
protected virtual void OnCanvasHierarchyChanged()
OnDestroy()
Declaration
protected virtual void OnDestroy()
OnDidApplyAnimationProperties()
Declaration
protected virtual void OnDidApplyAnimationProperties()
OnDisable()
Declaration
protected virtual void OnDisable()
OnEnable()
Declaration
protected virtual void OnEnable()
OnRectTransformDimensionsChange()
This callback is called when the dimensions of an associated RectTransform change. It is always called before Awake, OnEnable, or Start. The call is also made to all child RectTransforms, regardless of whether their dimensions change (which depends on how they are anchored).
Declaration
protected virtual void OnRectTransformDimensionsChange()
OnTransformParentChanged()
Declaration
protected virtual void OnTransformParentChanged()
Start()
Declaration
protected virtual void Start()