Ejemplo n.º 1
0
    public void StartGame(int Mode)
    {
        Scores.ResetScores();
        Scores.Checking = true;
        GameMode        = Mode;
        switch (Mode)
        {
        case 1:
            RacketOne.SetActive(true);
            RacketTwo.SetActive(true);
            Player1Trigger.SetActive(true);
            Player2Trigger.SetActive(true);
            break;

        case 2:
            RacketOne.SetActive(true);
            RacketTwo.SetActive(true);
            Player1Trigger.SetActive(true);
            Player2Trigger.SetActive(true);
            break;

        case 3:
            RacketOne.SetActive(true);
            Wall.SetActive(true);
            Player1Trigger.SetActive(true);
            Player2Trigger.SetActive(false);
            break;
        }
        Ball.SetActive(true);
        BallB.StartTheBallMoving(Mode);
    }
Ejemplo n.º 2
0
 public void PrepareBackground()
 {
     Ball.SetActive(false);
     Wall.SetActive(false);
     RacketOne.SetActive(false);
     RacketTwo.SetActive(false);
     Player1Trigger.SetActive(false);
     Player2Trigger.SetActive(false);
     for (int i = 0; i < BgElements.Length; i++)
     {
         BgElements[i].SetActive(true);
     }
     ShowBallRb.velocity = new Vector3(0, 0, 0);
     ShowBall.GetComponent <Transform>().position = ShowBallStartPos;
     ShowBallRb.AddForce(transform.right * 120);
     ShowBallRb.AddForce(transform.up * 40);
 }