diff options
Diffstat (limited to 'JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs')
-rw-r--r-- | JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs b/JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs new file mode 100644 index 0000000..360eecd --- /dev/null +++ b/JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs @@ -0,0 +1,42 @@ +using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace JamTools
+{
+
+ public class GizmosHandle : MonoBehaviour
+ {
+ public Action onDrawGizmos;
+
+ private static GizmosHandle m_Instance;
+
+ public static GizmosHandle Instance
+ {
+ get
+ {
+ return m_Instance;
+ }
+ }
+
+ public void DoGizmos(Action doGizmos)
+ {
+ onDrawGizmos += doGizmos;
+ }
+
+ private void Awake()
+ {
+ m_Instance = this;
+ }
+
+ private void OnDrawGizmos()
+ {
+ if (onDrawGizmos != null)
+ onDrawGizmos();
+ onDrawGizmos = null;
+ }
+
+ }
+
+}
|