added draw modw

This commit is contained in:
ikpil 2023-03-25 21:49:45 +09:00
parent 553f236320
commit 6ea72a1f9f
3 changed files with 9 additions and 13 deletions

View File

@ -73,6 +73,11 @@ public class DrawMode
Text = text;
}
public static DrawMode OfIdx(int idx)
{
return Values[idx];
}
public override string ToString()
{
return Text;

View File

@ -58,7 +58,7 @@ public class NavMeshRenderer
RcSettingsView rcSettingsView = sample.getSettingsUI();
debugDraw.fog(true);
debugDraw.depthMask(true);
DrawMode drawMode = rcSettingsView.getDrawMode();
var drawMode = rcSettingsView.getDrawMode();
float texScale = 1.0f / (rcSettingsView.getCellSize() * 10.0f);
float m_agentMaxSlope = rcSettingsView.getAgentMaxSlope();

View File

@ -69,8 +69,7 @@ public class RcSettingsView : IRcView
private int maxTiles;
private int maxPolys;
private int drawModeIdx = DrawMode.DRAWMODE_NAVMESH.Idx;
private DrawMode drawMode = DrawMode.DRAWMODE_NAVMESH;
private int drawMode = DrawMode.DRAWMODE_NAVMESH.Idx;
private string meshInputFilePath;
private bool meshInputTrigerred;
@ -211,16 +210,8 @@ public class RcSettingsView : IRcView
DrawMode.Values.forEach(dm =>
{
ImGui.RadioButton(dm.Text, ref drawModeIdx, dm.Idx);
ImGui.RadioButton(dm.Text, ref drawMode, dm.Idx);
});
// nk_window_get_bounds(ctx, rect);
// if (mouseX >= rect.x() && mouseX <= rect.x() + rect.w() && mouseY >= rect.y()
// && mouseY <= rect.y() + rect.h()) {
// mouseInside = true;
// }
// }
// nk_end(ctx);
// }
ImGui.NewLine();
ImGui.End();
@ -307,7 +298,7 @@ public class RcSettingsView : IRcView
public DrawMode getDrawMode()
{
return drawMode;
return DrawMode.Values[drawMode];
}
public float getEdgeMaxLen()