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();
        }
    }