Пример #1
0
        public static Path BuildImmediate(Map map, Vector start, Vector end, float aggression, bool moveDiognal, float maxDepthDiff, float depthDiffCostMultiplier, Int2D[] disallowedIndexes)
        {
            UtilityMonoBehaviour.CreateInstance();
            Path path = new Path();

            path.Initialise(Pathfinder.FindPathImmediate(start, end, map, aggression, moveDiognal, maxDepthDiff, depthDiffCostMultiplier, disallowedIndexes));
            return(path);
        }
Пример #2
0
        private static PathRequest RequestPath(Int2D Start, Int2D End, Map map, float estimateAggression, bool moveDiognal, float maxDepthDiff, float depthDiffCostMultiplier, Int2D[] disallowedIndexes, System.Action <Vector[]> OutputMethod)
        {
            if (RequestQue == null)
            {
                RequestQue = new System.Collections.Generic.Queue <PathRequest>();
            }

            UtilityMonoBehaviour.CreateInstance();
            PathRequest request = new PathRequest(Start, End, map, estimateAggression, moveDiognal, maxDepthDiff, depthDiffCostMultiplier, disallowedIndexes, OutputMethod);

            RequestQue.Enqueue(request);

            if (RequestProcessThread == null || !RequestProcessThread.IsAlive)
            {
                RequestProcessThread          = new Thread(ProcessRequests);
                RequestProcessThread.Priority = DefaultPriority;
                RequestProcessThread.Start();
            }

            return(request);
        }