diff --git a/src/DotRecast.Detour/DtStraightPathOption.cs b/src/DotRecast.Detour/DtStraightPathOption.cs new file mode 100644 index 0000000..323b2d7 --- /dev/null +++ b/src/DotRecast.Detour/DtStraightPathOption.cs @@ -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 Values = RcImmutableArray.Create( + None, AreaCrossings, AllCrossings + ); + + public readonly int Value; + public readonly string Label; + + private DtStraightPathOption(int value, string label) + { + Value = value; + Label = label; + } + } +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/Tools/TestNavmeshSampleTool.cs b/src/DotRecast.Recast.Demo/Tools/TestNavmeshSampleTool.cs index 133d22e..f45f134 100644 --- a/src/DotRecast.Recast.Demo/Tools/TestNavmeshSampleTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/TestNavmeshSampleTool.cs @@ -126,9 +126,9 @@ public class TestNavmeshSampleTool : ISampleTool { ImGui.Text("Vertices at crossings"); ImGui.Separator(); - ImGui.RadioButton("None", ref _option.straightPathOptions, 0); - ImGui.RadioButton("Area", ref _option.straightPathOptions, DtNavMeshQuery.DT_STRAIGHTPATH_AREA_CROSSINGS); - ImGui.RadioButton("All", ref _option.straightPathOptions, DtNavMeshQuery.DT_STRAIGHTPATH_ALL_CROSSINGS); + ImGui.RadioButton("None", ref _option.straightPathOptions, DtStraightPathOption.None.Value); + ImGui.RadioButton("Area", ref _option.straightPathOptions, DtStraightPathOption.AreaCrossings.Value); + ImGui.RadioButton("All", ref _option.straightPathOptions, DtStraightPathOption.AllCrossings.Value); } if (_option.mode == RcTestNavmeshToolMode.RANDOM_POINTS_IN_CIRCLE)