for unity3d

This commit is contained in:
ikpil 2023-09-03 16:51:41 +09:00
parent 32251f756f
commit a331b3e861
2 changed files with 27 additions and 3 deletions

View File

@ -0,0 +1,24 @@
using DotRecast.Core;
namespace DotRecast.Detour
{
public class DtStraightPathOption
{
public static readonly DtStraightPathOption None = new DtStraightPathOption(0, "None");
public static readonly DtStraightPathOption AreaCrossings = new DtStraightPathOption(DtNavMeshQuery.DT_STRAIGHTPATH_AREA_CROSSINGS, "Area");
public static readonly DtStraightPathOption AllCrossings = new DtStraightPathOption(DtNavMeshQuery.DT_STRAIGHTPATH_ALL_CROSSINGS, "All");
public static readonly RcImmutableArray<DtStraightPathOption> Values = RcImmutableArray.Create(
None, AreaCrossings, AllCrossings
);
public readonly int Value;
public readonly string Label;
private DtStraightPathOption(int value, string label)
{
Value = value;
Label = label;
}
}
}

View File

@ -126,9 +126,9 @@ public class TestNavmeshSampleTool : ISampleTool
{ {
ImGui.Text("Vertices at crossings"); ImGui.Text("Vertices at crossings");
ImGui.Separator(); ImGui.Separator();
ImGui.RadioButton("None", ref _option.straightPathOptions, 0); ImGui.RadioButton("None", ref _option.straightPathOptions, DtStraightPathOption.None.Value);
ImGui.RadioButton("Area", ref _option.straightPathOptions, DtNavMeshQuery.DT_STRAIGHTPATH_AREA_CROSSINGS); ImGui.RadioButton("Area", ref _option.straightPathOptions, DtStraightPathOption.AreaCrossings.Value);
ImGui.RadioButton("All", ref _option.straightPathOptions, DtNavMeshQuery.DT_STRAIGHTPATH_ALL_CROSSINGS); ImGui.RadioButton("All", ref _option.straightPathOptions, DtStraightPathOption.AllCrossings.Value);
} }
if (_option.mode == RcTestNavmeshToolMode.RANDOM_POINTS_IN_CIRCLE) if (_option.mode == RcTestNavmeshToolMode.RANDOM_POINTS_IN_CIRCLE)