public void Hit(float f) { AudioManagerB.PlaySound("hit"); golfball.AddForce(transform.forward * f, ForceMode.Impulse); nStrokes++; strokesT.text = nStrokes.ToString(); StartCoroutine(go()); }
private void OnTriggerEnter(Collider other) { if (other.tag == "hole") { Debug.Log("HOLEE"); //nStrokes = 0; strokesT.text = nStrokes.ToString(); AudioManagerB.PlaySound("hole"); holeEffect.Play(); LevelManager.instance.nextLevel(); } if (other.tag == "end") { UIManager.instance.endGame(nStrokes); //nStrokes = 0; } }