Esempio n. 1
0
    public void Init()
    {
        for (int i = 0; i < PotionScript.potionTypes.Count; i++)
        {
            potions.Add(new Queue <PotionScript>());
            statModifier.Add(new float());
        }

        Image hbi = GetComponentInChildren <HealthBarIdentifier>().GetComponent <Image>();
        Image sbi = GetComponentInChildren <StaminaBarIdentifier>().GetComponent <Image>();

        health  = new Bar(startHealth, hbi, hbi.transform.parent.GetComponentInChildren <MiddleBarScript>());
        stamina = new Bar(startStamina, sbi, sbi.transform.parent.GetComponentInChildren <MiddleBarScript>());


        ExpBarScript expBar = GetComponentInChildren <ExpBarScript>();

        if (expBar != null)
        {
            experience = new Bar(startExp, expBar.GetComponent <Image>(), expBar.transform.parent.GetComponentInChildren <MiddleBarScript>());
            experience.SetCurToZero();
        }

        PotionEffectIdentifier temp = GetComponentInChildren <PotionEffectIdentifier>();

        if (temp != null)
        {
            potionEffect = temp.gameObject;
            potionEffect.SetActive(false);
        }

        //Debug.Log("rpg initialized");
    }
Esempio n. 2
0
    public void Init()
    {
        health  = new Bar(startHealth, GetComponentInChildren <HealthBarIdentifier>().GetComponent <Image>());
        stamina = new Bar(startStamina, GetComponentInChildren <StaminaBarIdentifier>().GetComponent <Image>());


        ExpBarScript expBar = GetComponentInChildren <ExpBarScript>();

        if (expBar != null)
        {
            experience = new Bar(startExp, expBar.GetComponent <Image>());
            experience.SetCurToZero();
        }
    }