Beispiel #1
0
    private IEnumerator Countdown()
    {
        countdownEvent.Raise();

        player1.enabled            = false;
        player1.transform.position = player1Start;

        player2.enabled            = false;
        player2.transform.position = player2Start;

        ball.enabled            = false;
        ball.transform.forward  = pointsManager2.Points > pointsManager1.Points ? Vector3.forward : Vector3.back;
        ball.transform.position = ballStart - ball.transform.forward * ballOffset;
        ball.MakeVisible();

        countdownStart = Time.timeSinceLevelLoad;
        yield return(new WaitForSeconds(countdown));

        Play();
    }