mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
Update EntlongDrawer.cs
This commit is contained in:
parent
a8f08f2137
commit
fdbdb94b0c
@ -22,11 +22,10 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
int controlID = GUIUtility.GetControlID(s_ObjectFieldHash, FocusType.Keyboard, position);
|
int controlID = GUIUtility.GetControlID(s_ObjectFieldHash, FocusType.Keyboard, position);
|
||||||
|
|
||||||
bool containsMouse = dropRect.Contains(Event.current.mousePosition);
|
bool containsMouse = dropRect.Contains(Event.current.mousePosition);
|
||||||
bool dragPerform = eventType == EventType.DragPerform;
|
|
||||||
|
|
||||||
if(containsMouse && eventType == EventType.Repaint)
|
if(containsMouse && eventType == EventType.Repaint && DragAndDrop.activeControlID == controlID)
|
||||||
{
|
{
|
||||||
EditorStyles.selectionRect.Draw(dropRect.AddPadding(-1), UnityEditorUtility.GetLabelTemp(), controlID, DragAndDrop.activeControlID == controlID, position.Contains(Event.current.mousePosition));
|
EditorStyles.selectionRect.Draw(dropRect.AddPadding(-1), GUIContent.none, controlID, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -85,7 +84,9 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
|
DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragPerform)
|
if (eventType == EventType.DragPerform || eventType == EventType.DragUpdated)
|
||||||
|
{
|
||||||
|
if (eventType == EventType.DragPerform)
|
||||||
{
|
{
|
||||||
entlong ent = default;
|
entlong ent = default;
|
||||||
bool isValide = false;
|
bool isValide = false;
|
||||||
@ -106,7 +107,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
foreach (var beh in go.GetComponents<MonoBehaviour>())
|
foreach (var beh in go.GetComponents<MonoBehaviour>())
|
||||||
{
|
{
|
||||||
if(TryFindEntlong(beh, out ent))
|
if (TryFindEntlong(beh, out ent))
|
||||||
{
|
{
|
||||||
isValide = true;
|
isValide = true;
|
||||||
break;
|
break;
|
||||||
@ -152,8 +153,8 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
DragAndDrop.activeControlID = controlID;
|
DragAndDrop.activeControlID = controlID;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Event.current.Use();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryFindEntlong(Object uniObj, out entlong ent)
|
private bool TryFindEntlong(Object uniObj, out entlong ent)
|
||||||
|
Loading…
Reference in New Issue
Block a user