Assets/Scripts/Ball.cs
/// <summary>
/// OnCollisionEnter is called when this collider/rigidbody has begun
/// touching another rigidbody/collider.
/// </summary>
/// <param name="other">The Collision data associated with this collision.</param>
OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.
OnCollisionEnter is called when this collider / rigidbody has begun touching another rigidbody / collider .
void OnCollisionEnter(Collision other)
   {
      switch (other.gameObject.tag)
      {
         case "Player 1":
            lastPlayerHit = 1;
            break;
         case "Player 2":
            lastPlayerHit = 2;
            break;
      }
   }
void OnCollisionEnter ( Collision other ) { switch ( other . gameObject . tag ) { case " " : lastPlayerHit = 1 ; break ; case " " : lastPlayerHit = 2 ; break ; } }
OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.
OnCollisionEnter is called when this collider / rigidbody has begun touching another rigidbody / collider .
/*case "Top Border":
      GameController.Instance.GameState = GameController.GameStateEnum.P1Scored;
      if(GameController.Instance.scores.p1Score == 10)
         GameController.Instance.GameState = GameController.GameStateEnum.P1Won;
      break;
   case "Bottom Border":
      GameController.Instance.GameState = GameController.GameStateEnum.P2Scored;
      if(GameController.Instance.scores.p2Score == 10)
         GameController.Instance.GameState = GameController.GameStateEnum.P2Won;
      break;*/
other
Collision
The Collision data associated with this collision.
The Collision data associated with this collision .