From d682d0f6a31efa1493696bef165bb7e92657fbe7 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 29 Apr 2023 19:48:19 +0900 Subject: [PATCH] remove vector3f get_x, y, z proeprty --- src/DotRecast.Core/Vector3f.cs | 6 +++--- .../Unity/Astar/GraphMeta.cs | 14 +++++++++++--- .../Astar/UnityAStarPathfindingImporterTest.cs | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/DotRecast.Core/Vector3f.cs b/src/DotRecast.Core/Vector3f.cs index 95f592e..cca73ff 100644 --- a/src/DotRecast.Core/Vector3f.cs +++ b/src/DotRecast.Core/Vector3f.cs @@ -22,9 +22,9 @@ namespace DotRecast.Core { public struct Vector3f { - public float x { get; set; } - public float y { get; set; } - public float z { get; set; } + public float x; + public float y; + public float z; public static Vector3f Zero { get; } = new Vector3f(0, 0, 0); public static Vector3f Up { get; } = new Vector3f(0, 1, 0); diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs index 8fbdd19..38698b2 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/GraphMeta.cs @@ -20,6 +20,14 @@ using DotRecast.Core; namespace DotRecast.Detour.Extras.Unity.Astar { + // for unity meta parsing + public struct UnityVector3f + { + public float x { get; set; } + public float y { get; set; } + public float z { get; set; } + } + public class GraphMeta { public float characterRadius { get; set; } @@ -38,8 +46,8 @@ namespace DotRecast.Detour.Extras.Unity.Astar public float tileSizeZ { get; set; } public bool useTiles { get; set; } - public Vector3f rotation { get; set; } - public Vector3f forcedBoundsCenter { get; set; } - public Vector3f forcedBoundsSize { get; set; } + public UnityVector3f rotation { get; set; } + public UnityVector3f forcedBoundsCenter { get; set; } + public UnityVector3f forcedBoundsSize { get; set; } } } \ No newline at end of file diff --git a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs index e02bb0a..a962046 100644 --- a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs +++ b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs @@ -80,7 +80,7 @@ public class UnityAStarPathfindingImporterTest private NavMesh loadNavMesh(string filename) { var filepath = Loader.ToRPath(filename); - using var fs = new FileStream(filepath, FileMode.Open); + using var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read); // Import the graphs UnityAStarPathfindingImporter importer = new UnityAStarPathfindingImporter();