private void StopTransitioning() { StopCoroutine(_transitionCoroutine); _transitionCoroutine = null; if (_nextViews.Count > 0) { foreach (var pair in _nextViews) { GameObject viewObject = pair.Value; IViewExitAnimation animation = viewObject.GetComponent <IViewExitAnimation>(); animation?.Stop(); DisableOrDestroyView(pair.Key, pair.Value); } } }
private IPromise <GameObject> DoViewAnimation <TViewAnimation>(GameObject viewObject) where TViewAnimation : IViewAnimation { Promise <GameObject> promise = new Promise <GameObject>(); IViewExitAnimation animation = viewObject.GetComponent <IViewExitAnimation>(); if (animation != null) { animation.Animate(() => { promise.Resolve(viewObject); }); } else { promise.Resolve(viewObject); } return(promise); }