Ejemplo n.º 1
0
        protected override BTNodeStatus OnExcute(IAgent agent, Blackboard bb)
        {
            AIEntity entity = (AIEntity)agent;
            Vector3  target = bb.GetValue(BlackboardKey.TargetMovePos, Vector3.one);

            entity.Move(target);
            if (entity.AlreadyReachTarget(target, 1.0f))
            {
                HTLogger.Debug("已经到达目标点:" + target);
                return(BTNodeStatus.Finished);
            }
            //HTLogger.Debug("持续向目标点:" + target + "移动中");
            return(BTNodeStatus.Running);
        }
Ejemplo n.º 2
0
        protected override BTNodeStatus OnExcute(IAgent agent, Blackboard bb)
        {
            AIEntity entity = (AIEntity)agent;
            Vector3  target = bb.GetValue(BlackboardKey.TargetMovePos, Vector3.zero);

            entity.Turn(target);
            if (entity.AlreadyTurnToTarget(target, 0.1f))
            {
                HTLogger.Debug("已经转向目标点:" + target + "方向");
                return(BTNodeStatus.Finished);
            }
            HTLogger.Debug("持续向目标点:" + target + "方向转向中");
            return(BTNodeStatus.Running);
        }