예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (this.tag.Equals("BigPowerUp"))
     {
         calculator.AddPowerUp(5000);
         Destroy(this.gameObject);
         Debug.Log("5000");
     }
     else
     if (collision.tag.Equals("Player"))
     {
         calculator.AddPowerUp(100);
         Destroy(this.gameObject);
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (this.tag.Equals("Obstacle") && (collision.tag.Equals("Player")))
     {
         calculator.AddPowerUp(-1000);
         // Destroy(this.gameObject);
         Debug.Log("-1000");
     }
 }