public override void AnimateOut(Action onCloseAnimationEnded = null) { OnCloseBegan(); if (_shouldCloseImmediately) { _shouldCloseImmediately = false; if (Background != null) { Background.Clear(); } gameObject.SetActive(false); onCloseAnimationEnded.SafeInvoke(); OnClosed(); } else { CanvasGroup.interactable = false; AnimationStrategy.PerformCloseAnimation(this, () => { gameObject.SetActive(false); CanvasGroup.interactable = true; CloseBackground(() => { onCloseAnimationEnded.SafeInvoke(); OnClosed(); }); }); } }
public override void Enable() { OpenBackground(() => { gameObject.SetActive(true); CanvasGroup.interactable = false; AnimationStrategy.PerformOpenAnimation(this, () => { CanvasGroup.interactable = true; }); }); }
public override void AnimateIn(Action onOpenAnimationEnded = null) { OpenBackground(() => { transform.SetAsLastSibling(); gameObject.SetActive(true); CanvasGroup.interactable = false; OnOpenBegan(); AnimationStrategy.PerformOpenAnimation(this, () => { CanvasGroup.interactable = true; OnOpened(); onOpenAnimationEnded.SafeInvoke(); }); }); }