//处理增益技能 IEnumerator OnPassiveSkillUse(SkillInfo info) { state = PlayerState.SkillAttack; GetComponent <Animation>().CrossFade(info.aniname); yield return(new WaitForSeconds(info.anitime)); state = PlayerState.ControlWalk; 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); }
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; } }