protected virtual void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Ball") { //plays goal hit sound goalHit.Play(); // Hit by ball manager.scoreGoal(onLeft); } }
// Override this method for custom the goal trigger protected virtual void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Ball") { manager.PlaySound("Goal"); // Hit by ball manager.scoreGoal(onLeft); } }