Ejemplo n.º 1
0
 void OnTriggerExit(Collider other)
 {
     if (other.gameObject.tag == "Ground" || other.gameObject.tag == "Obstacle" || other.gameObject.tag == "Flammable" || other.gameObject.tag == "Boulder")
     {
         //Debug.Log(other.gameObject.tag);
         EarthAbility earthScript = earthAbility.GetComponent <EarthAbility>();
         earthScript.canSpawn = true;
     }
 }
Ejemplo n.º 2
0
    //MAGIC USE METHODS
    public void UseMagic()
    {
        GameObject abilitySystem = GameObject.Find("AbilitySystem");

        GameObject  fire        = abilitySystem.transform.Find("FireAbility").gameObject;
        FireAbility fireAbility = fire.GetComponent <FireAbility>();

        GameObject water        = abilitySystem.transform.Find("WaterAbility").gameObject;
        Water      waterAbility = water.GetComponent <Water>();

        GameObject air        = abilitySystem.transform.Find("AirAbility").gameObject;
        AirAbility airAbility = air.GetComponent <AirAbility>();

        GameObject   earth        = abilitySystem.transform.Find("EarthAbility").gameObject;
        EarthAbility earthAbility = earth.GetComponent <EarthAbility>();

        if (currManaAmount <= 20f)
        {
            if (fireAbility != null)
            {
                fireAbility.enabled = false;
            }
            if (waterAbility != null)
            {
                waterAbility.enabled = false;
            }
            if (airAbility != null)
            {
                airAbility.enabled = false;
            }
            if (earthAbility != null)
            {
                earthAbility.enabled = false;
            }
        }
        else if (currManaAmount >= 20f)
        {
            if (fireAbility != null)
            {
                fireAbility.enabled = true;
            }
            if (waterAbility != null)
            {
                waterAbility.enabled = true;
            }
            if (airAbility != null)
            {
                airAbility.enabled = true;
            }
            if (earthAbility != null)
            {
                earthAbility.enabled = true;
            }
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        parentName = transform.parent.name;

        if (parentName == "Itztli")
        {
            iScript = transform.parent.GetComponentInChildren <EarthAbility>();
        }
        else
        {
            tScript = transform.parent.GetComponentInChildren <WaterAbilities>();
        }
    }