Пример #1
0
    public void Setter(GameObject skillDescriptionPrefab, GameObject parent, GameObject content, string cls, int skillIndex, Skill skill, SKILLTYPE type)
    {
        this.skillDescriptionPrefab = skillDescriptionPrefab;
        this.parent     = parent;
        this.content    = content;
        this.skillIndex = skillIndex;
        this.cls        = cls;
        this.skill      = skill;
        this.type       = type;
        //characterImage.GetComponent<Image>().sprite = Resources.Load<Sprite>(Resource.PriestIdle) as Sprite;

        //Debug.Log(skill.name);
        skillInformation = SkillParser.GetSkill(SkillName.GetSkillNameFile(skill.name, cls, type), skill.level - 1);

        transform.Find("SkillOverview").Find("SkillName").GetComponent <Text>().text = skillInformation.skillName + " Lv." + skill.level;
        Color nameColor = new Color(0, 0, 0);

        if (type == SKILLTYPE.PAS)
        {
            nameColor = new Color(0.7f, 0.8f, 1f);
        }
        else
        {
            nameColor = new Color(1f, 0.8f, 0.8f);
        }
        transform.Find("SkillOverview").Find("SkillName").GetComponent <Text>().color = nameColor;

        transform.Find("SkillOverview").Find("SkillSummary").GetComponent <Text>().text = skillInformation.explain;
        transform.Find("SkillOverview").Find("SkillIcon").GetComponent <Image>().sprite =
            Resources.Load <Sprite>(skill.image);
    }
Пример #2
0
    public void Tooltip(Vector3 position, Skill skill, string cls, SKILLTYPE skillType)
    {
        //Set Position
        tooltip.transform.localPosition = position +
                                          new Vector3(-960.0f, -540.0f, 0) +
                                          new Vector3(-355.0f, -222.5f, 0);
        if (tooltip.transform.localPosition.y < -540 + 222.5)
        {
            tooltip.transform.localPosition =
                new Vector3(tooltip.transform.localPosition.x, -540 + 222.5f, tooltip.transform.localPosition.z);
        }
        if (tooltip.transform.localPosition.x < -960 + 355.0)
        {
            tooltip.transform.localPosition =
                new Vector3(-960 + 355.0f, tooltip.transform.localPosition.y, tooltip.transform.localPosition.z);
        }

        //TODO : Fill information

        //Set Panel Visible SkillName.GetSkillNameFile(skill.name, cls, type)
        SkillExplain skillExplain = SkillParser.GetSkill(SkillName.GetSkillNameFile(skill.name, cls, skillType), skill.level);

        skillImage.sprite = Resources.Load <Sprite>(skill.image);
        skillName.text    = skillExplain.skillName + " Lv." + skill.level;
        skillSummary.text = skillExplain.explain;
        skillCost.text    = "Cost : " + skillExplain.cost;
        skillAbility.text = skillExplain.ability;
        Utility.ObjectVisibility(tooltipPanel, true);
    }