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