コード例 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Player")
     {
         theScoreManager.AddScore(scoreToGive);
         gameObject.SetActive(false);
         if (coinSound.isPlaying)
         {
             coinSound.Stop();
             coinSound.Play();
         }
         else
         {
             coinSound.Play();
         }
     }
     if (other.gameObject.tag == "killbox")
     {
         theCoinGenerator.IsCollidedWithSpike();
     }
 }