public void OnClickButtonSpeakTest() { GameSkillBase skill = SkillManager.singleton.GetSkill(this.selectSkillId); //等音频播放结束后,然后角色播放动作 if (skill != null) { this.ShowSpeakButton(false); //出现口令 this.ShowToken(skill.skillConfig.skillRealToken); skill.Enter(this.entity, true); TimerManager.AddTimer(4000, 0, () => { this.ShowToken("", false); this.ShowSpeakButton(true); if (!GuideModel.singleton.bIsGuideAllComp && GuideModel.singleton.bIsSelfSpeaked == false) { //然后开始guide进入自己说 GuideModel.singleton.NowTaskId = 6005; GuideModel.singleton.bIsSelfSpeaked = true; EventDispatch.Broadcast(Events.DlgGuideExecuteNextTask); } }); } }
public void CastSkill(string token) { int skillId = -1; if (string.IsNullOrEmpty(token)) { if (!GuideModel.singleton.bIsGuideAllComp) { //再次尝试 GuideModel.singleton.NowTaskId = 6007; EventDispatch.Broadcast(Events.DlgGuideExecuteNextTask); } } else { //出现口令 skillId = SkillManager.singleton.MatchSkill(token); if (skillId == -1) { Debug.Log("匹配不到技能"); this.ShowToken(token); if (!GuideModel.singleton.bIsGuideAllComp) { //再次尝试 GuideModel.singleton.NowTaskId = 6007; EventDispatch.Broadcast(Events.DlgGuideExecuteNextTask); } } } GameSkillBase skill = SkillManager.singleton.GetSkill(skillId); if (skill != null) { this.ShowToken(skill.skillConfig.skillName); skill.Enter(this.entity, true); if (!GuideModel.singleton.bIsGuideAllComp) { TimerManager.AddTimer(4000, 0, () => { GuideModel.singleton.NowTaskId = 6008; EventDispatch.Broadcast(Events.DlgGuideExecuteNextTask); }); } } if (this.ShowTokenTimerId != uint.MinValue) { TimerManager.DelTimer(this.ShowTokenTimerId); this.ShowTokenTimerId = TimerManager.AddTimer(4000, 0, () => { this.ShowToken("", false); }); } else { this.ShowTokenTimerId = TimerManager.AddTimer(4000, 0, () => { this.ShowToken("", false); }); } }
// 状态处理 public void Process(EntityParent theOwner, params object[] args) { skill = (GameSkillBase)args[0]; if (SkillManager.singleton.IsSkillInRunning(skill.skillConfig.skillId)) { Debug.Log("runing:" + skill.skillConfig.skillName); return; } if (skill != null && skill.skillConfig != null) { skill.Enter(theOwner); this.curSkillId = skill.skillConfig.skillId; } }