private void FadeInWithoutAnimation() { if (IsFading) { _fadingState = FadingStates.FadingIn; _tween.SafelyAbort(); } else { OnEndedFadingIn(); } CanvasGroup.alpha = 1.0f; }
private void OnEndedFadingOut() { if (_isDestroyed) { return; } if (PreventInteractionWhenFading) { CanvasGroup.blocksRaycasts = false; CanvasGroup.interactable = false; } _fadingState = FadingStates.NotFading; IsVisible = false; EndedFadingOut.SafelyInvoke(); }
private void FadeOutWithAnimation() { _targetAlpha = 0.0f; if (PreventInteractionWhenFading) { CanvasGroup.blocksRaycasts = false; CanvasGroup.interactable = false; } _tween.SafelyAbort(); _tween = CanvasGroup.TweenAlpha() .To(_targetAlpha, FadeTime) .Easing(FadeEasing) .OnComplete(OnEndedFade) .Start(); _fadingState = FadingStates.FadingOut; StartedFadingOut.SafelyInvoke(); }