Esempio n. 1
0
    private void FixedUpdate()
    {
        switch (fade.GetFadeState())
        {
        case Fade.FadeState.FADE_STATE_IN:
            fade.FadeIn();
            break;

        case Fade.FadeState.FADE_STATE_OUT:
            fade.FadeOut();
            break;

        case Fade.FadeState.FADE_STATE_NEXT_SCENE:
            SceneManager.LoadScene("Result");
            break;

        default:
            if (playerObjWithFlick.GetIfGameOver())
            {
                fade.SetFadeState(Fade.FadeState.FADE_STATE_OUT);
                audioManager.PlaySE(AudioManager.SE.SE_GAME_OVER, 1, 0.2f);
            }
            break;
        }
    }
Esempio n. 2
0
        public static void FadeInGame(float duration = 1, float delay = 0, Color?color = null, Action callback = null)
        {
            // If fader is already open we dont need to animate it all over again
            if (GameFade.IsOpen)
            {
                if (callback != null)
                {
                    callback();
                }
                return;
            }

            GameFade.FadeSpriteRenderer.color = color.GetValueOrDefault();
            GameFade.FadeIn(duration, 0, 0.5f, delay, callback);
        }