Exemplo n.º 1
0
    public void LoadLevelTransition(int index)
    {
        if (index == GameManager.numberOfLevel - 1)
        {
            buttonPositionGameOver.HideNextLevel();
        }
        else
        {
            buttonPositionGameOver.DisplayNextLevel();
        }

        Sequence sequence = DOTween.Sequence();

        sequence.Append(_fade_forground.DOFade(1, .3f));
        sequence.AppendCallback(() => {
            HideGameOverMenu();
            _mainMenu.SetActive(false);
            _compatibility.gameObject.SetActive(false);
            LoadLevel(index);
        });
        _transitioning = true;
    }