refactor: class NavMeshSetHeader -> struct NavMeshSetHeader

This commit is contained in:
ikpil 2023-11-09 22:19:43 +09:00
parent afabec2b7d
commit b9ec4391f2
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ namespace DotRecast.Detour.Io
bool cCompatibility = header.version == NavMeshSetHeader.NAVMESHSET_VERSION;
DtNavMesh mesh = new DtNavMesh(header.option, header.maxVertsPerPoly);
ReadTiles(bb, is32Bit, header, cCompatibility, mesh);
ReadTiles(bb, is32Bit, ref header, cCompatibility, mesh);
return mesh;
}
@ -104,7 +104,7 @@ namespace DotRecast.Detour.Io
return header;
}
private void ReadTiles(RcByteBuffer bb, bool is32Bit, NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh)
private void ReadTiles(RcByteBuffer bb, bool is32Bit, ref NavMeshSetHeader header, bool cCompatibility, DtNavMesh mesh)
{
// Read tiles.
for (int i = 0; i < header.numTiles; ++i)

View File

@ -18,7 +18,7 @@ freely, subject to the following restrictions:
namespace DotRecast.Detour.Io
{
public class NavMeshSetHeader
public struct NavMeshSetHeader
{
public const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; // 'MSET';
public const int NAVMESHSET_VERSION = 1;
@ -28,7 +28,7 @@ namespace DotRecast.Detour.Io
public int magic;
public int version;
public int numTiles;
public DtNavMeshParams option = new DtNavMeshParams();
public DtNavMeshParams option;
public int maxVertsPerPoly;
}
}