コード例 #1
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.name == "right wall")
     {
         stateLeft = true;
         System.Console.WriteLine("HIT R WALL");
     }
     else if (collider.name == "left wall")
     {
         stateLeft = false;
         System.Console.WriteLine("HIT L WALL");
     }
     else if (collider.name == "top wall")
     {
         stateUp = false;
         System.Console.WriteLine("HIT T WALL");
         shrinkSize();
     }
     else if (collider.name == "botton wall")
     {
         stateUp = true;
         System.Console.WriteLine("HIT B WALL");
         //TODO Must lose one chance
         //shrink to half
         paddleController.InitialPosition();
         gameController.removeLife();
     }
 }