Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "enemy")
     {
         Destroy(this.gameObject);
         Destroy(collision.gameObject);
         Instantiate(Resources.Load("enemy_destroy", typeof(GameObject)), transform.position, Quaternion.identity);
         game_manager.update_score(single);
     }
 }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         player Player = collision.GetComponent <player>();
         Destroy(this.gameObject);
         Instantiate(Resources.Load("enemy_destroy", typeof(GameObject)), transform.position, Quaternion.identity);
         Player.destroy_player();
         game_manager.update_score(Player.single_player);
     }
 }