Exemple #1
0
 private void OnCollisionEnter(Collision collision)
 {
     foreach (Transform child in collision.gameObject.GetComponentInChildren <Transform>())
     {
         if ((child.gameObject.CompareTag("Physical Body") && this.Type == TipoCristal.Fisico) ||
             (child.gameObject.CompareTag("Spirit Body") && this.Type == TipoCristal.Espiritual))
         {
             if (!PlayerInventory.ExceedNumberOfCrystals(Type))
             {
                 PlayerInventory.AddCrystalToInventory(this);
                 IsInPlayerInventory = true;
                 MechanicObject.SetActive(false);
             }
         }
     }
 }