예제 #1
0
    public void setInfo(bool show)
    {
        info = false;
        info_panel.SetActive(show);
        if (show)
        {
            StatSum statsum = parent.rune.GetStats(false);
            for (int i = 0; i < labels.Count; i++)
            {
                //Debug.Log("Checking label " + labels[i].effect_type + "\n");
                StatBit statbit = statsum.GetStatBit(labels[i].effect_type);


                if (Get.isGeneric(statbit.effect_type) && statbit.hasStat())
                {
                    if (labels[i].type.Equals("info"))
                    {
                        labels[i].text.text = statbit.getDetailStats()[0].toString();
                        info = true;
                        //	Debug.Log("updating text for " + labels[i].effect_type + "\n");
                    }
                    else
                    {
                        labels[i].gameObject.SetActive(true);
                        info = true;
                        //Debug.Log("updating image for " + labels[i].effect_type + "\n");
                    }
                }
                else
                if (statbit.hasStat())
                {
                    if (labels[i].type.Equals("info"))
                    {
                        labels[i].text.text = statbit.getDetailStats()[0].toString();
                        info = true;
                        labels[i].gameObject.SetActive(true);
                        //	Debug.Log("updating text for " + labels[i].effect_type + "\n");
                    }
                    else
                    {
                        labels[i].gameObject.SetActive(true);
                        info = true;
                        //	Debug.Log("updating image for " + labels[i].name + " " + labels[i].effect_type + "\n");
                    }
                }
                else
                {
                    labels[i].gameObject.SetActive(false);
                }
            }
        }
    }
예제 #2
0
    public void SetSkill(StatBit statbit)
    {
        SpecialSkill s = _getSkill(statbit.effect_type);

        if (s == null)
        {
            Debug.Log("Skillmaster does not have a skill of type " + statbit.effect_type + "\n");
            return;
        }
        if (!statbit.hasStat())
        {
            Debug.Log("Setting null skill?\n");
            return;
        }



        // Debug.Log("Setting skill " + statbit.effect_type + "\n");
        s.Skill = statbit; //.GetClone();//should this be a clone or no?
        s.button.SetSkill();
        my_panel.UpdatePanel();

        // castle skills are always active but are still set up through buttons. To actually have the skill go off, have to simulate the click.
        //Architect = do it now, skill is always present
        //Renew = Regenerate_fake_button fake clicks when health goes down
        if (Get.isCastleSkill(statbit.effect_type) && CheckSkill(statbit.effect_type))
        {
            s.button.selected = false;
            if (statbit.effect_type == EffectType.Architect)
            {
                s.button.OnClick();
            }
        }
    }
    public void setInfoLabel(MyLabel label, Rune check_rune)
    {
        StatSum statsum = (check_rune != null) ? check_rune.GetStats(Get.isSpecial(label.effect_type)) : null;

        StatBit statbit = (statsum != null) ? statsum.GetStatBit(label.effect_type) : null;

        if (label.text != null)
        {
            label.text.text = "";
        }
        if (label.image_labels.Length > 0)
        {
            label.image_labels[0].setLabel("", 0);
        }

        if (statbit != null && statbit.hasStat())
        {
            int lvl = check_rune.getLevel(label.effect_type);
            if (label.text != null)
            {
                label.text.text = (lvl > 0) ? lvl.ToString() : "";
            }
            if (label.image_labels.Length > 0)
            {
                label.image_labels[0].setLabel("", lvl);
            }
        }
    }