diff options
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/UIBehaviour.cs')
-rw-r--r-- | Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/UIBehaviour.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/UIBehaviour.cs b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/UIBehaviour.cs new file mode 100644 index 0000000..523fe50 --- /dev/null +++ b/Assets/uGUI-2017.1/UnityEngine.UI/EventSystem/UIBehaviour.cs @@ -0,0 +1,59 @@ +namespace UnityEngine.EventSystems +{ + public abstract class UIBehaviour : MonoBehaviour + { + protected virtual void Awake() + {} + + protected virtual void OnEnable() + {} + + protected virtual void Start() + {} + + protected virtual void OnDisable() + {} + + protected virtual void OnDestroy() + {} + + public virtual bool IsActive() + { + return isActiveAndEnabled; + } + +#if UNITY_EDITOR + protected virtual void OnValidate() + {} + + protected virtual void Reset() + {} +#endif + + protected virtual void OnRectTransformDimensionsChange() + {} + + protected virtual void OnBeforeTransformParentChanged() + {} + + protected virtual void OnTransformParentChanged() + {} + + protected virtual void OnDidApplyAnimationProperties() + {} + + protected virtual void OnCanvasGroupChanged() + {} + + protected virtual void OnCanvasHierarchyChanged() + {} + + public bool IsDestroyed() + { + // Workaround for Unity native side of the object + // having been destroyed but accessing via interface + // won't call the overloaded == + return this == null; + } + } +} |