123456789101112131415161718192021222324252627282930313233 |
- using UnityEditor;
- using UnityEngine;
- using Rokid.UXR.Interaction;
- namespace Rokid.UXR.Editor
- {
- [CustomEditor(typeof(BoxProximityField))]
- public class BoxProximityFieldEditor : UnityEditor.Editor
- {
- private SerializedProperty _boxTransformProperty;
- private void Awake()
- {
- _boxTransformProperty = serializedObject.FindProperty("_boxTransform");
- }
- public void OnSceneGUI()
- {
- Debug.Log("Draw OnSceneGUI");
- Handles.color = EditorConstants.PRIMARY_COLOR;
- Transform boxTransform = _boxTransformProperty.objectReferenceValue as Transform;
- if (boxTransform != null)
- {
- using (new Handles.DrawingScope(boxTransform.localToWorldMatrix))
- {
- Handles.DrawWireCube(Vector3.zero, Vector3.one);
- }
- }
- }
- }
- }
|