diff options
author | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-02-18 14:38:20 +0800 |
commit | 63795c45af9ecca5aea36fbe291b18fcd9fb9b7d (patch) | |
tree | 60d811d8a0b1944ab32d24aa28394183b82cadeb /JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs | |
parent | a41c8da0787e0285d4c5b16a5cf5bc3e7a34f521 (diff) |
*rename folder name
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;
+ }
+
+ }
+
+}
|