Ejemplo n.º 1
0
 public void Hit(float f)
 {
     AudioManagerB.PlaySound("hit");
     golfball.AddForce(transform.forward * f, ForceMode.Impulse);
     nStrokes++;
     strokesT.text = nStrokes.ToString();
     StartCoroutine(go());
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }