void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "Player") { scoremanger.CoinCollected(1); scoremanger.AddScore(ScoreToGive); gameObject.SetActive(false); } }
private 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(); } } }
public void Modify() { ScoreManger.AddScore(point); Destroy(gameObject); }