public override void OnInitSkillBag(bool isNotifyUI = false) { if (SkillBag == null) { SkillBag = new List <ActorSkillInfo>(); } SkillBag.Clear(); //normal skill foreach (var item in CurrentTableInfo.NormalSkillIDList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item); if (skillInfo == null) { continue; } if (null == SkillBag.Find(info => info.SkillTableInfo.ID == item)) { SkillBag.Add(new ActorSkillInfo(skillInfo, 0)); } } { //open box skill SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(CurrentTableInfo.OpenBoxSkillID); if (skillInfo != null) { if (null == SkillBag.Find(info => info.SkillTableInfo.ID == skillInfo.ID)) { SkillBag.Add(new ActorSkillInfo(skillInfo, 0)); } } } base.OnInitSkillBag(isNotifyUI); }
public override bool OnFireSkill(int skillID) { if (IsDead) { return(false); } Actor.ActorSkillInfo info = SkillBag.Find(item => item.SkillTableInfo.ID == skillID); if (info == null) { Debug.LogError("skill bag is not contains,skillID:" + skillID + ",actorID:" + ID + ",type:" + Type); return(false); } if (!info.IsCanFire(this, skillID != 0)) { return(false); } if (info.SkillTableInfo.SkillType == (int)ENSkillType.enSkillNormalType) { return(FireNormalSkill()); } this.CurrentCmd = new Player.Cmd(skillID); return(true); }