//准备选择目标 void OnTargetSkillUse(SkillsInfo info) { state = PlayerState.SkillAttack; CursorManager.instance.SetTarget(); isLockingTarget = true; this.info = info; }
//增益技能 IEnumerator OnPassiveSkillUse(SkillsInfo info) { state = PlayerState.SkillAttack; GetComponent <Animation>().CrossFade(info.ani_name); yield return(new WaitForSeconds(info.ani_time)); state = PlayerState.ControlWalk; //实例化特效 GameObject prefab = null; efxDict.TryGetValue(info.efx_name, out prefab); Instantiate(prefab, transform.position, Quaternion.identity); int hp = 0, mp = 0; if (info.applyProperty == ApplyProperty.HP) { hp = info.applyValue; //作用值为hp } else if (info.applyProperty == ApplyProperty.MP) { mp = info.applyValue; //作用值为mp } ps.GetDrug(hp, mp); //使用加血加蓝技能相当于调用此函数 }
//增强技能 IEnumerator OnBuffSkillUse(SkillsInfo info) { state = PlayerState.SkillAttack; GetComponent <Animation>().CrossFade(info.ani_name); yield return(new WaitForSeconds(info.ani_time)); state = PlayerState.ControlWalk; //实例化特效 GameObject prefab = null; efxDict.TryGetValue(info.efx_name, out prefab); Instantiate(prefab, transform.position, Quaternion.identity); //都是乘以百分比 if (info.applyProperty == ApplyProperty.Attack) //增加攻击力 { ps.attack = (int)(ps.attack * (info.applyValue / 100f)); } else if (info.applyProperty == ApplyProperty.Def) //增加防御力 { ps.def = (int)(ps.def * (info.applyValue / 100f)); } else if (info.applyProperty == ApplyProperty.AttackSpeed) //增加攻击速度 { normalAttack_rate *= (int)(info.applyValue / 100f); if (normalAttack_rate > 1f) { normalAttack_rate = 1f; } } else if (info.applyProperty == ApplyProperty.Speed) //增加移动速度 { ps.speed = (int)(ps.speed * (info.applyValue / 100f)); } yield return(new WaitForSeconds(info.applyTime)); //作用时间 if (info.applyProperty == ApplyProperty.Attack) //增加攻击力 { ps.attack = (int)(ps.attack / (info.applyValue / 100f)); } else if (info.applyProperty == ApplyProperty.Def) //减少防御力 { ps.def = (int)(ps.def / (info.applyValue / 100f)); } else if (info.applyProperty == ApplyProperty.AttackSpeed) //减少攻击速度 { normalAttack_rate /= (int)(info.applyValue / 100f); } else if (info.applyProperty == ApplyProperty.Speed) //减少移动速度 { ps.speed = (int)(ps.speed / (info.applyValue / 100f)); } }
static int set_Instance(IntPtr L) { try { SkillsInfo arg0 = (SkillsInfo)ToLua.CheckUnityObject(L, 2, typeof(SkillsInfo)); SkillsInfo.Instance = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ReadSkillInfo(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); SkillsInfo obj = (SkillsInfo)ToLua.CheckObject(L, 1, typeof(SkillsInfo)); UnityEngine.TextAsset arg0 = (UnityEngine.TextAsset)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.TextAsset)); obj.ReadSkillInfo(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Awake() { m_SkillIcon = transform.Find("SkillIcon").GetComponent <Image>(); m_SkillName = transform.Find("SkillName").GetComponent <Text>(); m_SkillLevel = transform.Find("SkillLevel").GetComponent <Text>(); m_AddLevel = transform.Find("AddButton").GetComponent <Button>(); m_ClickBox = transform.Find("ClickBox").GetComponent <Button>(); m_ReduceLevel = transform.Find("ReduceButton").GetComponent <Button>(); m_ClickBox = transform.Find("ClickBox").GetComponent <Button>(); m_ClickBoxIMG = transform.Find("ClickBox").GetComponent <Image>(); skillpanel = transform.parent.parent.parent.parent.gameObject; m_SkillsInfo = skillpanel.GetComponent <SkillsInfo>(); m_SkillPanel = skillpanel.GetComponent <SkillPanel>(); m_ClickBox.onClick.AddListener(UpdateShowDesc); }
static int GetSkillInfoById(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); SkillsInfo obj = (SkillsInfo)ToLua.CheckObject(L, 1, typeof(SkillsInfo)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); SkillInfo o = obj.GetSkillInfoById(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void SetItem(int id, ShortCutType type) { this.gameObject.SetActive(true); this.id = id; this.type = type; if (type == ShortCutType.Skill) { skillsInfo = SkillInfo._instance.GetSkillsInfoById(id); icon.spriteName = skillsInfo.icon_name; } if (type == ShortCutType.Drug) { objectsInfo = ObjectInfo._instance.GetOjectInfoById(id); icon.spriteName = objectsInfo.icon_name; } }
void Awake() { Instance = this; m_audioSource = this.GetComponent <AudioSource>(); m_sprite = GameObject.FindGameObjectWithTag("Player").GetComponent <Sprite>(); m_startCtrl = this.transform.Find("StartCtrl"); // 隐藏游戏结果 m_result = this.transform.Find("Result"); m_result.gameObject.SetActive(false); // 获取游戏信息 Transform infos = this.transform.Find("Infos"); if (infos != null) { m_scoreText = infos.Find("Score").GetComponent <Text>(); m_skillsInfo = infos.Find("Skills").GetComponent <SkillsInfo>(); } // 重置分数 ResetScore(); }
public void UseSkill(SkillsInfo info) //根据技能类型,使用技能 { switch (info.applyType) { case ApplyType.Passive: //增益技能 StartCoroutine(OnPassiveSkillUse(info)); break; case ApplyType.Buff: //增强技能 StartCoroutine(OnBuffSkillUse(info)); break; case ApplyType.SingleTarget: //单个目标攻击 OnTargetSkillUse(info); break; case ApplyType.MultipleTarget: //群体目标攻击 OnTargetSkillUse(info); break; } }
void Awake() { _instance = this; initSkillInfoDic(); }
void Awake() { _instance = this; InitSkillInfoDict();//init the skill dictionary }
// Use this for initialization void Awake () { _instance = this; InitSkillInfo ();//初始化技能信息字典 }