예제 #1
0
        public static PathRequest <TPath> Create <TPath>(IPathfinder <TPath> pathfinder, int start, int end, PathfindaxCollisionCategory collisionCategory = PathfindaxCollisionCategory.None, byte agentSize = 1)
            where TPath : IPath
        {
            var request = new PathRequest <TPath>(start, end, collisionCategory, agentSize);

            pathfinder.RequestPath(request);
            return(request);
        }
예제 #2
0
        public async void Update()
        {
            //Request a path.
            var pathRequest = _pathfinder.RequestPath(new Vector2(0, 0), new Vector2(2, 0));

            Console.WriteLine($"Solving path from {pathRequest.PathStart} to {pathRequest.PathEnd}...");

            //Await the pathrequest
            var completedPath = await pathRequest;

            Console.WriteLine($"Solved path! {completedPath}");
            Console.WriteLine("ASyncExample completed. Press any key to continue with the next example.");
            CallBackCalled = true;
        }