using UnityEngine; using UnityEditor; using UnityEditor.IMGUI.Controls; namespace UDE_HAND_INTERACTION { [CustomEditor(typeof(FingerPressInteractor))] public class FingerPressInteractorEditor : EditorUtils { private SphereBoundsHandle _sphereHandle = new(); private FingerPressInteractor _interactor; private SerializedProperty _pointProperty; private void Awake() { _interactor = target as FingerPressInteractor; _sphereHandle.SetColor(new Color(0f, 1f, 1f, 0.5f)); _sphereHandle.midpointHandleDrawFunction = null; _pointProperty = serializedObject.FindProperty("TipTransform"); } private void OnSceneGUI() { DrawSphereEditor(); } private void DrawSphereEditor() { Transform transform = _pointProperty.objectReferenceValue as Transform; if (transform == null) { return; } _sphereHandle.radius = _interactor.Radius; _sphereHandle.center = transform.position; _sphereHandle.DrawHandle(); } } }