From 63795c45af9ecca5aea36fbe291b18fcd9fb9b7d Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 18 Feb 2022 14:38:20 +0800 Subject: *rename folder name --- .../Assets/JamUtils/Scripts/Utils/GizmosHandle.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs (limited to 'JamHelper/Assets/JamUtils/Scripts/Utils/GizmosHandle.cs') 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; + } + + } + +} -- cgit v1.1-26-g67d0