public MyBehaviorTreeState GotoAndAimTarget(float rotationAngle = 2)
 {
     if (!AiTargetBase.HasTarget())
     {
         return(MyBehaviorTreeState.FAILURE);
     }
     if (Bot.Navigation.Navigating)
     {
         if (Bot.Navigation.Stuck)
         {
             return(MyBehaviorTreeState.FAILURE);
         }
         else
         {
             return(MyBehaviorTreeState.RUNNING);
         }
     }
     else if (Bot.Navigation.HasRotation(MathHelper.ToRadians(rotationAngle)))
     {
         return(MyBehaviorTreeState.RUNNING);
     }
     else
     {
         return(MyBehaviorTreeState.SUCCESS);
     }
 }
예제 #2
0
 public void Init_AimAtTarget()
 {
     if (AiTargetBase.HasTarget())
     {
         AiTargetBase.AimAtTarget();
     }
 }
 protected override void Init_GotoTarget()
 {
     if (AiTargetBase.HasTarget())
     {
         AiTargetBase.GotoTargetNoPath(0.0f);
         m_bot.Navigation.AimWithMovement();
     }
 }
 public void Init_GotoAndAimTarget()
 {
     if (AiTargetBase.HasTarget())
     {
         AiTargetBase.GotoTarget();
         AiTargetBase.AimAtTarget();
     }
 }