Пример #1
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.tag == "Player" && !iBar.IsFull())
     {
         Destroy(gameObject);
     }
     if (collision.tag == "Player" && !iScreen.IsFull())
     {
         Destroy(gameObject);
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "loot" && !iScreen.IsFull())
     {
         sp            = other.gameObject.GetComponent(typeof(spellPickup)) as spellPickup;
         doCommunicate = true;
         recentPickUp  = sp.prefabToCopy;
     }
     if (other.tag == "loot" && !iBar.IsFull())
     {
         sp            = other.gameObject.GetComponent(typeof(spellPickup)) as spellPickup;
         doCommunicate = true;
         recentPickUp  = sp.prefabToCopy;
     }
     if (other.name == "JumpCube" || other.name == "JumpCube(clone)")
     {
         rb.AddRelativeForce(0, 1500, 0);
     }
 }