コード例 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag != gameObject.tag)
     {
         Destroy(other.gameObject);
         gmManager.UpdateScore(scoreToAdd);
     }
     else
     {
         Destroy(other.gameObject);
         gmManager.UpdateLives(damageToApplicate);
     }
 }
コード例 #2
0
 void Awake()
 {
     GetComponents();
     playerLives = PlayerPrefs.GetInt("PlayerLives", 2);
     gm.UpdateLives(playerLives);
 }