Пример #1
0
    public void setSkill(int id)
    {
        this.id = id;
        GameObject go = GameObject.Instantiate(skilliconPrefab, this.gameObject.transform);

        siInfo = SkillsInfo.instance.GetSkillInfoById(id);
        go.GetComponent <Image>().sprite = Resources.Load <Sprite>("Icon/" + siInfo.icon_name);
        type            = shortCutGridType.Skill;
        numText.enabled = true;
    }
Пример #2
0
    public void setDrug(int id, int num)
    {
        this.id      = id;
        this.num     = num;
        numText.text = num.ToString();
        GameObject go = GameObject.Instantiate(drugPrefab, this.gameObject.transform);

        obInfo = ObjectsInfo.instance.GetObjectInfoById(id);
        go.GetComponent <Image>().sprite = Resources.Load <Sprite>("Icon/" + obInfo.icon_name);
        type            = shortCutGridType.Drug;
        numText.enabled = true;
    }
Пример #3
0
    private void useDrug(int hp, int mp)
    {
        bool success = Inventory.instance.MinusID(id, 1);

        if (success)
        {
            ps.useDrug(hp, mp);
            this.num    -= 1;
            numText.text = num.ToString();
            if (num == 0)
            {
                ClearInfo();
                numText.enabled = false;
            }
        }
        else
        {
            type = shortCutGridType.None;
        }
    }