コード例 #1
0
ファイル: Health.cs プロジェクト: Bixkog/Colors_Exodus
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Circle(Clone)" &&
         other.gameObject.GetComponent <SetColor> ().COLOR
         == CuC.myColor)
     {
         other.gameObject.GetComponent <Click> ().destroyed();
         CuP.addPoints(CuS.start_speed);
         Destroy(other.gameObject);
         if (catched.enabled)
         {
             catched.Play();
         }
         BG.GetComponent <ActivateBonus> ().passed();
     }
     else
     {
         addHealth(-1);
         Destroy(other.gameObject);
         if (missed.enabled)
         {
             missed.Play();
         }
         BG.GetComponent <ActivateBonus> ().missed();
     }
 }