示例#1
0
    public void OnSceneTransition(string sceneName, TransitionType transitionType, Action callback = null)
    {
        isWork = false;
        Action action = () =>
        {
            callback?.Invoke( );
            StartCoroutine(SceneTransition(sceneName));
        };

        canvasGroup.blocksRaycasts = true;
        current = transitionEffects[transitionType];
        current.OnFadeIn(action);
    }
示例#2
0
    public void OnTransition(TransitionType transitionType, Action callback_FadeIn = null, Action callback_FadeOut = null)
    {
        Action action = () =>
        {
            callback_FadeIn?.Invoke( );
            Action endAction = () =>
            {
                callback_FadeOut?.Invoke( );
                canvasGroup.blocksRaycasts = false;
            };
            current.OnFadeOut(endAction);
        };

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

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

        canvasGroup.blocksRaycasts = true;
        current = transitionEffects[transitionType];
        if (effectFactor >= 0f)
        {
            current.EffectFactor = effectFactor;
        }
        current.OnFadeIn(action);
    }