Skip to content

Commit 06442c3

Browse files
committed
0.6.1
Change yellow -> cyan for vertex to indice Add custom menu to open help Make readme clear (was rejected in asset store 🙁)
1 parent 5b2ae17 commit 06442c3

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

Assets/Plugins/MeshDebugger/Editor/MeshDebugger.cs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using UnityEngine.UI;
66

77
[ExecuteInEditMode]
8-
public partial class MeshDebugger : EditorWindow
8+
public partial class MeshDebugger : EditorWindow, IHasCustomMenu
99
{
1010
public Mesh m_Mesh;
1111
public Transform m_Transform;
@@ -107,11 +107,24 @@ void OnSelectionChange()
107107
Repaint();
108108
}
109109

110+
[ContextMenu("Show Help")]
111+
void ShowHelp()
112+
{
113+
Application.OpenURL("https://github.com/willnode/MeshDebugger/blob/master/INSTRUCTIONS.md");
114+
}
115+
116+
117+
public virtual void AddItemsToMenu(GenericMenu menu)
118+
{
119+
GUIContent content = new GUIContent("Show Help");
120+
menu.AddItem(content, false, this.ShowHelp);
121+
}
122+
110123
void OnSceneGUI(SceneView view)
111124
{
112125
if (Event.current.type != EventType.Repaint)
113126
return;
114-
127+
115128
if (!m_Mesh || !m_Mesh.isReadable)
116129
{
117130
if (m_Gizmo != null)
@@ -140,7 +153,7 @@ void OnSceneGUI(SceneView view)
140153

141154
if (m_DebugNormalVerts || m_DebugTangentVerts || m_DebugBinormalVerts || m_DebugVertsToIndice)
142155
{
143-
Color blue = Color.blue, green = Color.green, red = Color.red, yellow = Color.yellow;
156+
Color blue = Color.blue, green = Color.green, red = Color.red, cyan = Color.cyan;
144157
EachVert((i, vert) =>
145158
{
146159
if (m_DebugNormalVerts)
@@ -150,15 +163,16 @@ void OnSceneGUI(SceneView view)
150163
if (m_DebugBinormalVerts)
151164
m_Gizmo.AddRay(vert, m_cpu.m_Normals[2][i] * m_RaySize, red);
152165
if (m_DebugVertsToIndice)
153-
m_Gizmo.AddLine(vert, vert + m_cpu.m_VertToIndicesDir[i], yellow);
166+
m_Gizmo.AddLine(vert, vert + m_cpu.m_VertToIndicesDir[i], cyan);
154167
});
155168
}
156169

157170
if (m_DebugTrisNormal)
158171
{
172+
var color = Color.yellow;
159173
var norms = m_cpu.m_IndiceNormals;
160174
EachIndice((i, j, median) =>
161-
m_Gizmo.AddRay(median, norms[i][j] * m_RaySize, Color.yellow)
175+
m_Gizmo.AddRay(median, norms[i][j] * m_RaySize, color)
162176
);
163177
}
164178

@@ -221,14 +235,14 @@ void OnSceneGUI(SceneView view)
221235
m_hasUpdated = true;
222236
}
223237

224-
private bool IsSafeToDrawGUI ()
238+
private bool IsSafeToDrawGUI()
225239
{
226-
return ((m_DebugTris == DebugTriangle.None ? 0 : m_cpu.m_IndiceCountNormalized) +
227-
(m_DebugVert == DebugVertice.None ? 0 : m_cpu.m_VertCount)) *
240+
return ((m_DebugTris == DebugTriangle.None ? 0 : m_cpu.m_IndiceCountNormalized) +
241+
(m_DebugVert == DebugVertice.None ? 0 : m_cpu.m_VertCount)) *
228242
(m_PartialDebug ? (m_PartialDebugEnd - m_PartialDebugStart) : 1) < 2500;
229243
}
230244

231-
private void DrawGUILabels ()
245+
private void DrawGUILabels()
232246
{
233247
Handles.matrix = m_matrix = m_Transform.localToWorldMatrix;
234248
Handles.BeginGUI();
@@ -351,4 +365,4 @@ static Styles()
351365
}
352366

353367

354-
}
368+
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
MeshDebugger - 0.6 - MIT - https://github.com/willnode/MeshDebugger
1+
Thanks for using my plugin!
22

3-
To begin inspecting mesh, just navigate to Window -> Mesh Debugger in menu bar.
3+
MeshDebugger - 0.6.1 - Shared with ❤ - © Wildan Mubarok 2018 under MIT License.
4+
See https://github.com/willnode/MeshDebugger/blob/master/INSTRUCTIONS.md
5+
for instructions about using this plugin.

0 commit comments

Comments
 (0)