public override bool OnSelectSkill(EnumSkillType eType, int unSkillId) { Debug.Log("Use Skill Select Skill"); if (unSkillId == -1) { ActionState.Singleton.ChangeState(enumSubActionState.eSubActionState_Enable); return(true); } if (this.m_curState.OnSelectSkill(eType, unSkillId)) { return(true); } if (this.ChangeSkill(eType, unSkillId)) { SkillBase skill = null; EnumErrorCodeCheckUse errorCode = skill.CheckUse(Singleton <BeastRole> .singleton.Id); if (errorCode == EnumErrorCodeCheckUse.eCheckErr_Success) { this.m_curState.OnLockOperation(); } else { this.m_curState.ShowErrCheckUse(errorCode); ActionState.Singleton.ChangeState(enumSubActionState.eSubActionState_Enable); } } return(true); }
public virtual void UpdateState() { Debug.Log("UpdateState"); float y = Input.mousePosition.y; float num = y / Screen.height; if (num > 0.27f && !this.m_bOutMainUI) { SkillBase skill = SkillGameManager.GetSkillBase(this.m_unSkillId); if (skill != null) { EnumErrorCodeCheckUse errorCode = skill.CheckUse(Singleton <BeastRole> .singleton.Id); if (errorCode != EnumErrorCodeCheckUse.eCheckErr_Success) { this.ShowErrCheckUse(errorCode); } else { this.m_bOutMainUI = true; //当鼠标离开UI做的处理 } } } if (num < 0.25f && this.m_bOutMainUI) { this.m_bOutMainUI = false; //当鼠标进入UI做的处理 } }
/// <summary> /// 取得该神兽能使用的技能列表 /// </summary> /// <returns></returns> public List <int> GetCanUseSkills() { List <int> list = new List <int>(); foreach (var data in this.m_listSkillData) { SkillBase skillStrategy = SkillGameManager.GetSkillBase(data.Id); if (skillStrategy != null) { if (skillStrategy.CheckUse(this.m_unMasterBeastId) == EnumErrorCodeCheckUse.eCheckErr_Success) { list.Add(data.Id); } } } return(list); }