Beispiel #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("EndPoints"))
     {
         if (other == currentHole.end && !inHole)
         {
             inHole = true;
             GameManager.instance.HoleSuccess();
             currentHole = GameManager.instance.GetCurrentHole();
         }
         else
         {
             Debug.Log("Wrong hole!!");
         }
     }
     if (other.gameObject.CompareTag("Green"))
     {
         //Debug.Log("Trigger in green");
         GameManager.instance.inGreenZone = true;
         GameManager.instance.NextClub();
     }
     if (other.gameObject.CompareTag("Bunker"))
     {
         GameManager.instance.inBunkerZone = true;
         GameManager.instance.NextClub();
         SetDrag();
     }
     if (other.gameObject.CompareTag("Water"))
     {
         GameManager.instance.InWater();
         inWater = true;
     }
 }
Beispiel #2
0
 void NextHole()
 {
     GameManager.instance.currentHole++;
     GameManager.instance.inGreenZone  = false;
     GameManager.instance.inBunkerZone = false;
     currentHole = GameManager.instance.GetCurrentHole();
     Reset();
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("Ball start");
     rigidbody   = GetComponent <Rigidbody>();
     currentHole = GameManager.instance.GetCurrentHole();
 }