Esempio n. 1
0
    public void AttachBall(GameObject ball)
    {
        ball.transform.parent        = transform;
        ball.transform.localPosition = new Vector3(0, 0.175f, 0);
        ball.GetComponent <Collider2D> ().enabled = false;

        BallMovement ballScript = ball.GetComponent <BallMovement> ();

        ballScript.Pause();

        attachedBalls.Add(ball);
    }
Esempio n. 2
0
 private void PauseGame()
 {
     GameObject[] balls = GameObject.FindGameObjectsWithTag("Ball");
     for (int i = 0; i < balls.Length; i++)
     {
         GameObject   ball   = balls[i];
         BallMovement script = ball.GetComponent <BallMovement>();
         if (script != null)
         {
             script.Pause();
         }
     }
 }