Esempio n. 1
0
        private void UpdatePath()
        {
            if (Level.Loaded == null)
            {
                return;
            }

            if (pathFinder == null)
            {
                pathFinder = new PathFinder(WayPoint.WayPointList, false);
            }

            Vector2 target;

            if (navigateTactically)
            {
                target = ConvertUnits.ToSimUnits(AITacticalTarget);
            }
            else if (LevelEndSelected)
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.EndExitPosition);
            }
            else
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.StartExitPosition);
            }
            steeringPath = pathFinder.FindPath(ConvertUnits.ToSimUnits(controlledSub == null ? item.WorldPosition : controlledSub.WorldPosition), target, errorMsgStr: "(Autopilot, target: " + target + ")");
        }
Esempio n. 2
0
        private void UpdatePath()
        {
            if (pathFinder == null)
            {
                pathFinder = new PathFinder(WayPoint.WayPointList, false);
            }

            Vector2 target;

            if (LevelEndSelected)
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.EndPosition);
            }
            else
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.StartPosition);
            }
            steeringPath = pathFinder.FindPath(ConvertUnits.ToSimUnits(controlledSub == null ? item.WorldPosition : controlledSub.WorldPosition), target, "(Autopilot, target: " + target + ")");
        }
Esempio n. 3
0
        private void UpdatePath()
        {
            if (pathFinder == null)
            {
                pathFinder = new PathFinder(WayPoint.WayPointList, false);
            }

            Vector2 target;

            if (LevelEndSelected)
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.EndPosition);
            }
            else
            {
                target = ConvertUnits.ToSimUnits(Level.Loaded.StartPosition);
            }


            steeringPath = pathFinder.FindPath(ConvertUnits.ToSimUnits(item.WorldPosition), target);
        }