Пример #1
0
    private IEnumerator GameStartSequence()
    {
        vaus.SetControlsActive(false);
        float _duration;

        if (intro)
        {
            lm.LoadLevel(levelProgress);
            vaus.transform.position = new Vector2(LevelManager.playArea.width / 2f, 1f);

            vaus.ResizePaddle(LevelManager.playArea.width, 0, 1);
            yield return(new WaitForSeconds(2f));

            UIManager.instance.TitleFadeout(3f);
        }
        else
        {
            lm.DestroyPreviousLevel();
            _duration = 1f;

            StartCoroutine(Helpers.MoveObjectOverTimeSequence(vaus.transform, new Vector2(LevelManager.playArea.width / 2f, 1f), _duration, 3));
            vaus.ResizePaddle(LevelManager.playArea.width, _duration, 3f);

            yield return(new WaitForSeconds(_duration));

            lm.LoadLevel(levelProgress);

            yield return(new WaitForSeconds(0.5f));
        }

        _duration = 1f;
        vaus.ResizePaddle(vaus.defaultBasePaddleLength, _duration, 4);
        yield return(new WaitForSeconds(_duration));

        vaus.SpawnStartingBalls();

        yield return(new WaitForSeconds(0.75f));


        vaus.SetControlsActive(true);
        allowEvents = true;
        intro       = false;

        yield return(null);
    }