Skip to content

Commit 31d07b2

Browse files
Squashed commit of the following:
commit a96b43b Author: Jon McCreadie <[email protected]> Date: Sat Apr 27 20:32:13 2024 +0100 Lil clean. Moved the namespace and using directives into the #if block. commit 43f832e Author: Jon McCreadie <[email protected]> Date: Sat Apr 27 20:10:07 2024 +0100 Update com.mccdev260.gizmo-tool.asmdef Errors showing up in builds because I forgot to exclude the tool from builds. Fixed now.
1 parent 6fc57e7 commit 31d07b2

File tree

4 files changed

+413
-382
lines changed

4 files changed

+413
-382
lines changed

Editor/GizmoDrawer.cs

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
using UnityEngine;
2-
3-
namespace MccDev260.GizmoTool
4-
{
51
#if UNITY_EDITOR
6-
[ExecuteInEditMode]
7-
public class GizmoDrawer : MonoBehaviour
2+
using UnityEngine;
3+
4+
namespace MccDev260.GizmoTool
85
{
9-
[SerializeField] private bool drawOnSelectOnly;
6+
[ExecuteInEditMode]
7+
public class GizmoDrawer : MonoBehaviour
8+
{
9+
[SerializeField] private bool drawOnSelectOnly;
1010

11-
#region Properties
12-
//Shared
13-
[HideInInspector] public Transform originTransform;
14-
[HideInInspector] public Vector3 originPos;
15-
[HideInInspector] public GizmoType gizmoType;
16-
[HideInInspector] public Color gizmoColor = Color.blue;
11+
#region Properties
12+
//Shared
13+
[HideInInspector] public Transform originTransform;
14+
[HideInInspector] public Vector3 originPos;
15+
[HideInInspector] public GizmoType gizmoType;
16+
[HideInInspector] public Color gizmoColor = Color.blue;
1717

18-
//Icon
19-
[HideInInspector] public string filePathString;
20-
[HideInInspector] public bool allowScaling;
18+
//Icon
19+
[HideInInspector] public string filePathString;
20+
[HideInInspector] public bool allowScaling;
2121

22-
//Sphere
23-
[HideInInspector] public float floatRadius = 1f;
24-
//Cube
25-
[HideInInspector] public bool uniformScale;
26-
[HideInInspector] public Vector3 scale = Vector3.one;
22+
//Sphere
23+
[HideInInspector] public float floatRadius = 1f;
24+
//Cube
25+
[HideInInspector] public bool uniformScale;
26+
[HideInInspector] public Vector3 scale = Vector3.one;
2727

28-
// Mesh
29-
[HideInInspector] public Mesh mesh;
30-
[HideInInspector] public Vector3 meshRotation;
31-
[HideInInspector] public bool useAttachedTransformValues;
32-
[HideInInspector] public bool useMeshOnFilter;
33-
//Line
34-
[HideInInspector] public Transform targetTransform;
35-
[HideInInspector] public Vector3 targetPosition;
28+
// Mesh
29+
[HideInInspector] public Mesh mesh;
30+
[HideInInspector] public Vector3 meshRotation;
31+
[HideInInspector] public bool useAttachedTransformValues;
32+
[HideInInspector] public bool useMeshOnFilter;
33+
//Line
34+
[HideInInspector] public Transform targetTransform;
35+
[HideInInspector] public Vector3 targetPosition;
3636

37-
//LineList & LineStrip
38-
[HideInInspector] public Vector3[] points = new Vector3[0];
37+
//LineList & LineStrip
38+
[HideInInspector] public Vector3[] points = new Vector3[0];
3939

40-
[HideInInspector] public bool useTransformArray;
41-
[HideInInspector] public Transform[] transformPoints = new Transform[0];
40+
[HideInInspector] public bool useTransformArray;
41+
[HideInInspector] public Transform[] transformPoints = new Transform[0];
4242

43-
[HideInInspector] public bool looped;
43+
[HideInInspector] public bool looped;
4444

45-
// GUI Texture
46-
/// <summary>
47-
/// The size and position of the texture on the "screen" defined by the XY plane.
48-
/// </summary>
49-
[HideInInspector] public Rect screenRect;
50-
/// <summary>
51-
/// The texture to be displayed.
52-
/// </summary>
53-
[HideInInspector] public Texture texture;
54-
/// <summary>
55-
/// An optional material to apply the texture.
56-
/// </summary>
57-
[HideInInspector] public Material mat;
58-
#endregion
45+
// GUI Texture
46+
/// <summary>
47+
/// The size and position of the texture on the "screen" defined by the XY plane.
48+
/// </summary>
49+
[HideInInspector] public Rect screenRect;
50+
/// <summary>
51+
/// The texture to be displayed.
52+
/// </summary>
53+
[HideInInspector] public Texture texture;
54+
/// <summary>
55+
/// An optional material to apply the texture.
56+
/// </summary>
57+
[HideInInspector] public Material mat;
58+
#endregion
5959

60-
private void OnDrawGizmosSelected()
61-
{
62-
if (drawOnSelectOnly)
63-
GizmoTool.DrawGizmo(this);
64-
}
60+
private void OnDrawGizmosSelected()
61+
{
62+
if (drawOnSelectOnly)
63+
GizmoTool.DrawGizmo(this);
64+
}
6565

66-
private void OnDrawGizmos()
67-
{
68-
if (!drawOnSelectOnly)
69-
GizmoTool.DrawGizmo(this);
66+
private void OnDrawGizmos()
67+
{
68+
if (!drawOnSelectOnly)
69+
GizmoTool.DrawGizmo(this);
70+
}
7071
}
7172
}
7273
#endif
73-
}

0 commit comments

Comments
 (0)