Exemplo n.º 1
0
    void Update()
    {
        if (_fader)
        {
            if (_doingFadeIn && !_doingFadeOut)
            {
                _doingFadeIn = !_fader.DoFadeIn(2.0f);
            }
            if (_doingFadeOut && !_doingFadeIn)
            {
                _doingFadeOut = !_fader.DoFadeOut(2.0f);
            }
        }

        if (_startedUiExitFade)
        {
            StartButtonClicked();
        }

        if (_waitToFadeMenusInTimer > 0.0f)
        {
            _waitToFadeMenusInTimer -= Time.deltaTime;
        }

        if (_waitToFadeMenusInTimer <= 0.0f && !_fadedInMenus)
        {
            _fadedInMenus = true;
            StartCoroutine(FadeCanvasGroupAlpha(0f, 1f, StartMenuGroup, true));
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (_fader)
        {
            if (_doingFadeIn && !_doingFadeOut)
            {
                _doingFadeIn = !_fader.DoFadeIn(2.0f);
            }
            if (_doingFadeOut && !_doingFadeIn)
            {
                _doingFadeOut = !_fader.DoFadeOut(2.0f);
            }
        }

        if (_startedExitFade)
        {
            if (!_doingFadeOut)
            {
                if (NextSceneToUse == "")
                {
                    SceneManager.LoadScene("FirstLevel");
                }
                else
                {
                    SceneManager.LoadScene(NextSceneToUse);
                }
            }
        }
    }
Exemplo n.º 3
0
    void Update()
    {
        if (_fader)
        {
            if (_doingFadeIn && !_doingFadeOut)
            {
                _doingFadeIn = !_fader.DoFadeIn(2.0f);
            }
            if (_doingFadeOut && !_doingFadeIn)
            {
                _doingFadeOut = !_fader.DoFadeOut(2.0f);
            }
        }



        switch (_currentState)
        {
        case LevelState.Init:
        {
            StateInit();
            break;
        }

        case LevelState.Placement:
        {
            StatePlacement();
            break;
        }

        case LevelState.PlayerInit:
        {
            StatePlayerInit();
            break;
        }

        case LevelState.Update:
        {
            StateUpdate();
            break;
        }

        case LevelState.StageOver:
        {
            StateStageOver();
            break;
        }

        case LevelState.GameOver:
        {
            StateGameOver();
            break;
        }

        case LevelState.Shutdown:
        {
            StateShutdown();
            break;
        }
        }
    }