Exemplo n.º 1
0
 private void OnTriggerStay(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         gManager = GameObject.Find("GlobalManager").GetComponent <globalManager> ();
         if (health)
         {
             gotHealth(other.gameObject);
         }
         if (defence)
         {
             gotDefence(other.gameObject);
         }
         if (reload)
         {
             gotReload(other.gameObject);
         }
         if (bSpeed)
         {
             gotbSpeed(other.gameObject);
         }
         if (dmg)
         {
             gotDmg(other.gameObject);
         }
         if (runSpeed)
         {
             gotRunSpeed(other.gameObject);
         }
         if (currency)
         {
             gotCurrency(other.gameObject);
         }
     }
 }
 void Awake()
 {
     rigidbody             = GetComponent <Rigidbody> ();
     animator              = GetComponent <Animator>();
     gManager              = GameObject.Find("GlobalManager").GetComponent <globalManager> ();
     playerHealthControler = GetComponent <healthControler> ();
     updateItems();
 }
Exemplo n.º 3
0
 void Awake()
 {
     _instance = this;
 }