refactor: annotation builder

This commit is contained in:
ikpil 2023-09-23 07:57:47 +09:00
parent 707d91afea
commit 4f2cc63886
2 changed files with 9 additions and 7 deletions

View File

@ -54,9 +54,6 @@ public class JumpLinkBuilderSampleTool : ISampleTool
public void Layout() public void Layout()
{ {
if (0 >= _sample.GetRecastResults().Count)
return;
ImGui.Text("Options"); ImGui.Text("Options");
ImGui.Separator(); ImGui.Separator();
ImGui.SliderFloat("Ground Tolerance", ref _cfg.groundTolerance, 0f, 2f, "%.2f"); ImGui.SliderFloat("Ground Tolerance", ref _cfg.groundTolerance, 0f, 2f, "%.2f");
@ -82,6 +79,7 @@ public class JumpLinkBuilderSampleTool : ISampleTool
//int buildTypes = 0; //int buildTypes = 0;
ImGui.CheckboxFlags("Climb Down", ref _cfg.buildTypes, JumpLinkType.EDGE_CLIMB_DOWN.Bit); ImGui.CheckboxFlags("Climb Down", ref _cfg.buildTypes, JumpLinkType.EDGE_CLIMB_DOWN.Bit);
ImGui.CheckboxFlags("Edge Jump", ref _cfg.buildTypes, JumpLinkType.EDGE_JUMP.Bit); ImGui.CheckboxFlags("Edge Jump", ref _cfg.buildTypes, JumpLinkType.EDGE_JUMP.Bit);
ImGui.NewLine();
//option.buildTypes = buildTypes; //option.buildTypes = buildTypes;
bool build = false; bool build = false;
@ -97,12 +95,17 @@ public class JumpLinkBuilderSampleTool : ISampleTool
} }
if (build || _cfg.buildOffMeshConnections) if (build || _cfg.buildOffMeshConnections)
{
if (0 < _sample.GetRecastResults().Count)
{ {
var geom = _sample.GetInputGeom(); var geom = _sample.GetInputGeom();
var settings = _sample.GetSettings(); var settings = _sample.GetSettings();
_tool.Build(geom, settings, _sample.GetRecastResults(), _cfg); _tool.Build(geom, settings, _sample.GetRecastResults(), _cfg);
} }
}
ImGui.NewLine();
ImGui.Text("Debug Draw Options"); ImGui.Text("Debug Draw Options");
ImGui.Separator(); ImGui.Separator();

View File

@ -23,7 +23,6 @@ namespace DotRecast.Recast.Toolset.Tools
return "Annotation Builder"; return "Annotation Builder";
} }
public void Clear() public void Clear()
{ {
_annotationBuilder = null; _annotationBuilder = null;