Skip to content

Commit 91b17c2

Browse files
Fix missing default shapes property
1 parent cd0512b commit 91b17c2

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Packages/UGF.DebugTools/Editor/DebugGLComponentEditor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ namespace UGF.DebugTools.Editor
99
internal class DebugGLComponentEditor : UnityEditor.Editor
1010
{
1111
private SerializedProperty m_propertyEnable;
12+
private SerializedProperty m_propertyDefaultShapes;
1213
private SerializedProperty m_propertyDefaultMaterial;
1314
private AssetReferenceListDrawer m_listShapes;
1415

1516
private void OnEnable()
1617
{
1718
m_propertyEnable = serializedObject.FindProperty("m_enable");
19+
m_propertyDefaultShapes = serializedObject.FindProperty("m_defaultShapes");
1820
m_propertyDefaultMaterial = serializedObject.FindProperty("m_defaultMaterial");
1921
m_listShapes = new AssetReferenceListDrawer(serializedObject.FindProperty("m_shapes"));
2022
m_listShapes.Enable();
@@ -30,6 +32,7 @@ public override void OnInspectorGUI()
3032
using (new SerializedObjectUpdateScope(serializedObject))
3133
{
3234
EditorGUILayout.PropertyField(m_propertyEnable);
35+
EditorGUILayout.PropertyField(m_propertyDefaultShapes);
3336
EditorGUILayout.PropertyField(m_propertyDefaultMaterial);
3437

3538
m_listShapes.DrawGUILayout();

Packages/UGF.DebugTools/Runtime/DebugGLComponent.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ private void Start()
4141

4242
m_drawer.SetDefaultMaterial(m_defaultMaterial ? m_defaultMaterial : DebugGLUtility.CreateDefaultMaterial());
4343

44-
m_drawer.AddShape(DebugGL.ShapeLineWireId, DebugGLUtility.CreateShapeLineWire());
45-
m_drawer.AddShape(DebugGL.ShapeTriangleWireId, DebugGLUtility.CreateShapeTriangleWire());
46-
m_drawer.AddShape(DebugGL.ShapeQuadWireId, DebugGLUtility.CreateShapeQuadWire());
47-
m_drawer.AddShape(DebugGL.ShapeCircleWireId, DebugGLUtility.CreateShapeCircleWire());
48-
m_drawer.AddShape(DebugGL.ShapeCubeWireId, DebugGLUtility.CreateShapeCubeWire());
49-
m_drawer.AddShape(DebugGL.ShapeSphereWireId, DebugGLUtility.CreateShapeSphereWire());
50-
m_drawer.AddShape(DebugGL.ShapeCylinderWireId, DebugGLUtility.CreateShapeCylinderWire());
44+
if (m_defaultShapes)
45+
{
46+
m_drawer.AddShape(DebugGL.ShapeLineWireId, DebugGLUtility.CreateShapeLineWire());
47+
m_drawer.AddShape(DebugGL.ShapeTriangleWireId, DebugGLUtility.CreateShapeTriangleWire());
48+
m_drawer.AddShape(DebugGL.ShapeQuadWireId, DebugGLUtility.CreateShapeQuadWire());
49+
m_drawer.AddShape(DebugGL.ShapeCircleWireId, DebugGLUtility.CreateShapeCircleWire());
50+
m_drawer.AddShape(DebugGL.ShapeCubeWireId, DebugGLUtility.CreateShapeCubeWire());
51+
m_drawer.AddShape(DebugGL.ShapeSphereWireId, DebugGLUtility.CreateShapeSphereWire());
52+
m_drawer.AddShape(DebugGL.ShapeCylinderWireId, DebugGLUtility.CreateShapeCylinderWire());
53+
}
5154

5255
for (int i = 0; i < m_shapes.Count; i++)
5356
{

0 commit comments

Comments
 (0)