コード例 #1
0
ファイル: EnemyController.cs プロジェクト: wayn3r/aliengame
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Destroyer")
     {
         BalloonExplosion();
     }
     else if (other.gameObject.tag == "Bullet")
     {
         musicPlayer.clip = explosionClip;
         musicPlayer.Play();
         rb2d.velocity = Vector2.up * 0;
         UpdateState("BalloonDie");
         player.SendMessage("IncreaseHelium", (colors[indexColor] == "blue"?blueBalloonPoints:normalPoints));
         Destroy(collider2D);
     }
 }