Exemple #1
0
        public static IEnumerable<Vector> FindPath(string filename, Vector start, Vector end)
        {
            var ptr = _FindPath(filename, start.X, start.Y, start.Z, end.X, end.Y, end.Z);
            var size = Marshal.ReadInt32(ptr);

            for (var i = 0; i < size; ++i) {
                yield return Marshal.PtrToStructure<Vector>(ptr + 4 + i * 4);
            };
        }
Exemple #2
0
 private IList <Point> GetPoints(string filename, NavMesh.Vector start, NavMesh.Vector end)
 {
     return(Mesh.FindPath(filename, start, end).Select(vector => new Point(vector.X, vector.Y)).ToList());
 }