Пример #1
0
    IEnumerator OnPassiveSkillUse(SkillInfo info)
    {
        pa.bigstate = PlayerState.SkillAttack;
        GetComponent <Animation>().CrossFade(info.aniname);
        yield return(new WaitForSeconds(info.anitime));

        pa.bigstate = PlayerState.ControlWalkState;
        int hp = 0, mp = 0;

        if (info.applyProperty == ApplyProperty.HP)
        {
            hp = info.applyValue;
        }
        else if (info.applyProperty == ApplyProperty.MP)
        {
            mp = info.applyValue;
        }

        ps.GetDrug(hp, mp);
        //实例化特效
        GameObject prefab = null;

        efxDict.TryGetValue(info.efx_name, out prefab);
        GameObject.Instantiate(prefab, transform.position, Quaternion.identity);
    }
Пример #2
0
 void LateUpdate()
 {
     if (flag)
     {
         if (Input.GetMouseButtonDown(1))
         {
             item_dis.instance.gameObject.SetActive(false);  
             EquipAndBag_Grid now = transform.parent.gameObject.GetComponent <EquipAndBag_Grid> ();
             if (now.id >= 1001 && now.id <= 1003)
             {
                 if (id == 0)
                 {
                     return;
                 }
                 objectInfo info = ObjectsInfo.instance.FindObjecInfoById(now.id);
                 int        hp   = info.hp;
                 int        mp   = info.mp;
                 ps.GetDrug(hp, mp);
                 transform.parent.GetComponent <EquipAndBag_Grid> ().MinsNumber();
             }
             else if (now.id >= 2001 && now.id <= 2023)
             {
                 bool success = Equip.instance.Dress(now.id);
                 if (success)
                 {
                     transform.parent.GetComponent <EquipAndBag_Grid> ().MinsNumber();
                 }
             }
         }
     }
 }
Пример #3
0
    public void OndrugUse()
    {
        bool success = inventory._instance.MinusId(id, 1);

        if (success)
        {
            ps.GetDrug(objectinfo.hp, objectinfo.mp);
        }
        else
        {
            type = shortcuttype.None;
            icon.gameObject.SetActive(false);
            id         = 0;
            skillinfo  = null;
            objectinfo = null;
        }
    }
Пример #4
0
    public void UseDrug()
    {
        if (id == 0)
        {
            return;
        }
        int hp = obinfo.hp;
        int mp = obinfo.mp;

        ps.GetDrug(hp, mp);
        count--;
        if (count <= 0)
        {
            count_text.gameObject.SetActive(false);
            this.id            = 0;
            this.obinfo        = null;
            img.overrideSprite = null;
            type = ShortCutType.None;
        }
        else
        {
            count_text.text = count.ToString();
        }
    }