void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Player") { ScoreScript.AddPoint(); sound1.Play(); } }
private void OnTriggerEnter(Collider other) { if (!hasPoint) { hasPoint = true; Debug.Log("entered"); audioSource.Play(); ss.AddPoint(); Destroy(gameObject); } }
public void GetCoin() { scoreScript.AddPoint(); coinSound.GetComponent <AudioSource>().Play(); }
void OnDestroy() { ScoreScript.AddPoint(); }
void Start() { ScoreScript.AddPoint(); Destroy(gameObject, 2f); }