diff --git a/Assets/RuntimeGizmo/TransformGizmo.cs b/Assets/RuntimeGizmo/TransformGizmo.cs index fdf4550..e4e4a1b 100644 --- a/Assets/RuntimeGizmo/TransformGizmo.cs +++ b/Assets/RuntimeGizmo/TransformGizmo.cs @@ -1,5 +1,6 @@ using System; using UnityEngine; +using UnityEngine.Events; using System.Collections.Generic; using System.Collections; using CommandUndoRedo; @@ -126,7 +127,10 @@ public class TransformGizmo : MonoBehaviour Coroutine forceUpdatePivotCoroutine; static Material lineMaterial; - static Material outlineMaterial; + public Material outlineMaterial; + + public UnityEvent onSelect; + public UnityEvent onDeselect; void Awake() { @@ -675,6 +679,8 @@ public void AddTarget(Transform target, bool addCommand = true) AddTargetHighlightedRenderers(target); SetPivotPoint(); + + onSelect.Invoke(); } } @@ -690,6 +696,8 @@ public void RemoveTarget(Transform target, bool addCommand = true) RemoveTargetRoot(target); SetPivotPoint(); + + onDeselect.Invoke(); } }