public override void Enter() { base.Enter(); DebugMsg.Log("进入警戒状态"); OnComplete(); }
public override void Enter() { base.Enter(); DebugMsg.Log("进入战斗待机状态"); _time = 0; SetAgentState(KeyNameEnum.NEAR_ENEMY, false); }
public void UpdateData() { //检测是否需要重新制定计划 //当前计划是否完成 if (planHandler.IsComplete) { DebugMsg.Log("制定新计划"); BuildPlanAndStart(); } //制定计划并开始计划 void BuildPlanAndStart() { if (goalManager.CurrentGoal != null) { DebugMsg.Log("----------------新的目标:" + goalManager.CurrentGoal.Label.ToString()); } //若目标完成则重新寻找目标 var plan = planner.BuildPlan(goalManager.CurrentGoal); if (plan != null && plan.Count > 0) { planHandler.Init(actionManager, plan); planHandler.HandlerAction(); actionManager.IsPerformAction = true; } } }
public override void Enter() { base.Enter(); DebugMsg.Log("进入移动状态"); _self = (Transform)_agent.Maps.GetGameData(DataName.SELF_TRANS); _enemy = (Transform)_agent.Maps.GetGameData(DataName.ENEMY_TRANS); _controller = _self.GetComponent <CharacterController>(); }
public async override void Enter() { DebugMsg.Log("进入受伤状态"); //模拟受伤状态的延时时间 await Task.Delay(TimeSpan.FromSeconds(2)); OnComplete(); }
public void UpdateData() { if (WhetherToReplan()) { DebugMsg.Log("制定新计划"); BuildPlanAndStart(); } }
//计划完成了当前动作 private void PlanActionComplete(TAction actionLabel) { DebugMsg.Log("下一步"); if (_planHandler.GetCurrentHandler().Label.ToString() == actionLabel.ToString()) { _planHandler.NextAction(); } }
public override void Execute() { base.Execute(); if (_time < 2) { _time += Time.fixedDeltaTime; } else { DebugMsg.Log("战斗待机状态完成"); OnComplete(); } }
public void UpdateData() { if (_agent.IsAgentOver) { return; } if (WhetherToReplan()) { DebugMsg.Log("制定新计划"); BuildPlanAndStart(); } }
//制定计划并开始计划 private void BuildPlanAndStart() { if (_goalManager.CurrentGoal != null) { DebugMsg.Log("----------------新的目标:" + _goalManager.CurrentGoal.Label.ToString()); } //若目标完成则重新寻找目标 var plan = _planner.BuildPlan(_goalManager.CurrentGoal); if (plan != null && plan.Count > 0) { _planHandler.Init(_actionManager, plan); _planHandler.StartPlan(); _actionManager.IsPerformAction = true; } }
public override void Enter() { DebugMsg.Log("进入受伤状态:" + Label); int injureValue = GetGameDataValue <int>(GameDataKeyEnum.INJURE_VALUE); EnemyData data = GetGameData <EnemyData>(GameDataKeyEnum.CONFIG); data.Life = data.Life - injureValue; isDead = data.Life <= 0; if (isDead) { SetAgentState(StateKeyEnum.IS_DEAD, true); } else { base.Enter(); } }
public Performer(IAgent <TAction, TGoal> agent) { planHandler = new PlanHandler <TAction>(); planHandler.AddCompleteCallBack(() => { //计划完成 DebugMsg.Log("计划完成"); actionManager.IsPerformAction = false; }); planner = new Planner <TAction, TGoal>(agent); goalManager = agent.GoalManager; actionManager = agent.ActionManager; actionManager.AddActionCompleteListener((actionLabel) => { //计划完成了当前动作 DebugMsg.Log("下一步"); if (planHandler.GetCurrentHandler().Label.ToString() == actionLabel.ToString()) { planHandler.HandlerAction(); } }); }
public override void Enter() { base.Enter(); DebugMsg.Log("进入警戒状态"); _data = GetGameData <GameDataKeyEnum, EnemyData>(GameDataKeyEnum.CONFIG); }
//计划完成 private void PlanComplete() { DebugMsg.Log("计划完成"); _actionManager.IsPerformAction = false; }
public override void Exit() { DebugMsg.Log("退出警戒状态"); }
public override void Enter() { base.Enter(); DebugMsg.Log("进入待机状态"); }
public void Interruptible() { DebugMsg.Log("打断计划"); planHandler.Interruptible(); }
public override void Exit() { base.Exit(); DebugMsg.Log("退出战斗待机状态"); }
public override void Enter() { base.Enter(); DebugMsg.Log("进入攻击待机状态"); CreateTimer(Const.IDLE_SWORD_DELAY_TIME); }