Example #1
0
 /**
  * This method creates a trigger that causes an item to be collected,
  * @param other the collectible item is being collided with
  */
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "WordGem")         //make word gems disappear
     {
         gemTracker.RemoveGem();                    //Update tracker by 1
         other.gameObject.SetActive(false);
         health.Heal(gemHealingPower);
     }
     if (other.gameObject.tag == "Food")         //make food disappear
     {
         other.gameObject.SetActive(false);
     }
 }