예제 #1
0
 public bool CheckIfCrystalAvailable(TipoCristal type)
 {
     foreach (Crystal crystal in CrystalsInInventory)
     {
         if (crystal.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
    // Não pode haver mais de um cristal de cada tipo na possessão no player
    public bool ExceedNumberOfCrystals(TipoCristal type)
    {
        foreach (Crystal crystal in CrystalsInInventory)
        {
            if (crystal.Type == type)
            {
                return(true);
            }
        }

        return(false);
    }
예제 #3
0
    public Crystal RetriveCrystalToPedestal(TipoCristal type)
    {
        foreach (Crystal crystal in CrystalsInInventory)
        {
            if (crystal.Type == type)
            {
                CrystalsInInventory.Remove(crystal);

                if (crystal.Type == TipoCristal.Fisico)
                {
                    transition.getCurrentStateBody().gameObject.GetComponentInChildren <ParticleSystem>(true).transform.parent.gameObject.SetActive(false);
                }
                else if (crystal.Type == TipoCristal.Espiritual)
                {
                    transition.getCurrentStateBody().gameObject.GetComponentInChildren <ParticleSystem>(true).transform.parent.gameObject.SetActive(false);
                }

                return(crystal);
            }
        }
        return(null);
    }