/// <summary> /// 接受任务 /// </summary> private void GetTask() { TaskInfoService.PlayerGetNewTask(CurrentTaskId); //向玩家的InfoModel中添加此任务 MYXZUIManager.Instance.PopPanel(); //关闭MessageBoxPanel MYXZUIManager.Instance.PopPanel(); //关闭TalkPanel FinishTalkSignal.Dispatch(); //通知玩家对话已经结束 }
public override void OnRemove() { PlayerView.EscSignal.RemoveListener(KeyEscDown); PlayerView.UseSkillSignal.RemoveListener(UseSkill); FinishTalkSignal.RemoveListener(TalkFinish); ResGetCharaInfoSignal.RemoveListener(GetCharaInfo); ResGetPlayerTransformSignal.RemoveListener(SetPlayerPosition); }
public override void OnRegister() { ResGetPlayerTransformSignal.AddListener(SetPlayerPosition); PlayerView.EscSignal.AddListener(KeyEscDown); PlayerView.UseSkillSignal.AddListener(UseSkill); FinishTalkSignal.AddListener(TalkFinish); ResGetCharaInfoSignal.AddListener(GetCharaInfo); RegisterSkillSignal.Dispatch(this.gameObject, PlayerView.SkillTreeID); ReqGetPlayerTransformSignal.Dispatch(); mTimer = 0; PlayerView.Character.UseSkill = () => StartCoroutine(SkillUsing()); }
public override void Execute() { if (IsTask) //如果刚才的交谈是接取任务的交谈,弹出一个MessageBox来确定是否接受此任务 { MessageBoxPanelView messageBox = MYXZUIManager.Instance.GetPanel(UIPanelType.MessageBoxPanel) as MessageBoxPanelView; messageBox.CancelEvent = RefuseTask; //按下取消键 messageBox.ConfirmEvent = GetTask; //按下确定键 messageBox.MessageText.text = "是否接取任务" + MYXZGameDataManager.Instance.GetTaskById(CurrentTaskId).Name; //显示的消息 PushPanelSignal.Dispatch(UIPanelType.MessageBoxPanel); //弹出 } else //如果只是平常的对话 { MYXZUIManager.Instance.PopPanel(); //关闭对话框 FinishTalkSignal.Dispatch(); //通知玩家对话已经结束 } }
public override void OnRegister() { this.View.Player = new Player(this.gameObject); InitPlayerSignal.Dispatch(this.View.Player); MYXZUIManager.Instance.PushPanel(UIPanelType.WorldSpaceBackGroundPanel); ResGetPlayerTransformSignal.AddListener(SetPlayerPosition); View.EscSignal.AddListener(KeyEscDown); // View.UseSkillSignal.AddListener(UseSkill); // View.BeAttackedSignal.AddListener(BeAttacked); FinishTalkSignal.AddListener(TalkFinish); ResGetCharaInfoSignal.AddListener(GetCharaInfo); RegisterSkillSignal.Dispatch(this.gameObject, View.SkillTreeID); // ReqGetPlayerTransformSignal.Dispatch(); // View.Character.UseSkill = () => StartCoroutine(SkillUsing()); // ReqGetCharacterInfoSignal.Dispatch(); }
/// <summary> /// 拒绝接受任务 /// </summary> private void RefuseTask() { MYXZUIManager.Instance.PopPanel(); //关闭MessageBoxPanel MYXZUIManager.Instance.PopPanel(); //关闭TalkPanel FinishTalkSignal.Dispatch(); //通知玩家对话已经结束 }