Beispiel #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Bullet")
     {
         Destroy(gameObject); //ลบตัวเอง
         Gamecontroller.Addscore(scorevalue);
     }
 }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Bullet")
     {
         Destroy(other.gameObject);
         lifes -= 1;
         if (lifes <= 0)
         {
             Destroy(gameObject);
         }
         Gamecontroller.Addscore(scorevalue);
     }
 }
Beispiel #3
0
 public static void heart(int add, int score)
 {
     playerlifes++;
     //Gamecontroller gcl = new Gamecontroller();
     Gamecontroller.Addscore(score);
 }