public override void Reason(float timeElapse) { if (timeElapse > _Duration) { MMachine.PerformTransition(EBehaviourTransition.ToIdle); } }
public override void Reason(float timeElapse) { base.Reason(timeElapse); //---没有下一步就停下 if (MHeroController._NextDirection == EDirection.None) { MMachine.PerformTransition(EBehaviourTransition.ToIdle); return; } if (NoumenonT.position.MDistanceIgnoreY(aimPosition) < 0.08f) { //-- MHeroController.SetCurToNext(); MHeroController.CleanNext(); if (MHeroController._AimDirection != EDirection.None) { bool canMove = MissionManager.I.CanMove(MHeroController.MCurCoordinate, MHeroController._AimDirection); if (canMove) { MHeroController.SetAimToNext(); aimPosition = MHeroController.GetNextPosition(); } MHeroController.CleanAim(); MHeroController.TrunToNext(); } } }
public void OnDirectionContrl(EDirection dir) { bool canMove = MissionManager.I.CanMove(MHeroController.MCurCoordinate, dir); //---转向方向; MHeroController.TrunToDirection(dir); if (canMove) { MHeroController.SetNextDirection(dir); MMachine.PerformTransition(EBehaviourTransition.ToMove); } }
public void OnFire() { MMachine.PerformTransition(EBehaviourTransition.ToKick); }