From d2ab30e7a69bfe7efda63ae75812207377917bd3 Mon Sep 17 00:00:00 2001
From: miepzerino <o.skotnik@gmail.com>
Date: Sun, 30 Mar 2025 18:50:27 +0000
Subject: [PATCH] Merge branch 'Flexalon-UI-Layouts' into develop
---
Assets/Flexalon/Editor/Interaction/FlexalonDragTargetEditor.cs | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/Assets/Flexalon/Editor/Interaction/FlexalonDragTargetEditor.cs b/Assets/Flexalon/Editor/Interaction/FlexalonDragTargetEditor.cs
new file mode 100644
index 0000000..f890e2a
--- /dev/null
+++ b/Assets/Flexalon/Editor/Interaction/FlexalonDragTargetEditor.cs
@@ -0,0 +1,28 @@
+using UnityEditor;
+using UnityEngine;
+
+namespace Flexalon.Editor
+{
+ [CustomEditor(typeof(FlexalonDragTarget)), CanEditMultipleObjects]
+ public class FlexalonDragTargetEditor : FlexalonComponentEditor
+ {
+ void OnSceneGUI()
+ {
+ // Draw a box at the transforms position
+ var script = target as FlexalonDragTarget;
+ var node = Flexalon.GetNode(script.gameObject);
+ if (node == null || node.Result == null)
+ {
+ return;
+ }
+
+ var r = node.Result;
+
+ // Draw hit box for drag target if margin is not zero.
+ Handles.color = Color.green;
+ var worldBoxScale = node.GetWorldBoxScale(true);
+ Handles.matrix = Matrix4x4.TRS(node.GetWorldBoxPosition(worldBoxScale, false), script.transform.rotation, worldBoxScale);
+ Handles.DrawWireCube(Vector3.zero, r.AdapterBounds.size + script.Margin * 2);
+ }
+ }
+}
\ No newline at end of file
--
Gitblit v1.10.0