Ejemplo n.º 1
0
    public void OnTransition(TransitionType startTransitionType, TransitionType endTransitionType, Action callback_FadeIn = null, Action callback_FadeOut = null)
    {
        Action action = () =>
        {
            callback_FadeIn?.Invoke( );
            current.EffectFactor = 0f;
            current = transitionEffects[endTransitionType];
            current.EffectFactor = 1f;

            Action endAction = () =>
            {
                callback_FadeOut?.Invoke( );
                canvasGroup.blocksRaycasts = false;
            };
            current.OnFadeOut(endAction);
        };

        canvasGroup.blocksRaycasts = true;
        current = transitionEffects[startTransitionType];
        current.OnFadeIn(action);
    }
Ejemplo n.º 2
0
    /// <param name="effectFactor">만약 음수라면 원래의 값을 사용합니다.</param>
    public void OnFadeOut(TransitionType transitionType, Action callback = null, float effectFactor = 1f)
    {
        Action action = () =>
        {
            callback?.Invoke( );
            current.EffectFactor       = 0f;
            canvasGroup.blocksRaycasts = false;
        };

        if (current != null && current.IsFade && !current.Equals(transitionEffects[transitionType]))
        {
            current.EffectFactor = 0f;
        }

        current = transitionEffects[transitionType];
        if (effectFactor >= 0f)
        {
            current.EffectFactor = effectFactor;
        }
        current.OnFadeOut(action);
    }