예제 #1
0
    private IEnumerator ShowGameOverSequence(Promise promise)
    {
        _curtainCanvas.DOFade(0, 0);
        _text.DOFade(0, 0);
        _gameOverView.CanvasGroup.DOFade(0, 0);

        _gameOverView.Hide();

        yield return(new WaitForSeconds(.65f));

        _curtainAnimator.SetTrigger("Close");

        yield return(new WaitForSeconds(1f));

        _curtainCanvas.DOFade(1, .35f);

        yield return(new WaitForSeconds(.35f));

        _gameOverView.gameObject.SetActive(true);
        _gameOverView.CanvasGroup.DOFade(1f, .45f);

        yield return(new WaitForSeconds(.25f));

        _gameOverView.Show();

        promise.Resolve();
    }
예제 #2
0
    void Start()
    {
        _lobby.Show();
        _gameOver.Hide();

        _lobby.OnPlay += () =>
        {
            _lobby.Hide();
            StartGame();
        };

        _gameOver.OnLobby += () =>
        {
            EndGame();
            _gameOver.Hide();
            _lobby.Show();
        };

        _gameOver.OnRestart += () =>
        {
            _gameOver.Hide();
            StartGame();
        };
    }