mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-17 17:34:34 +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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (dragPerform)
|
||||
if (eventType == EventType.DragPerform || eventType == EventType.DragUpdated)
|
||||
{
|
||||
if (eventType == EventType.DragPerform)
|
||||
{
|
||||
entlong ent = default;
|
||||
bool isValide = false;
|
||||
@ -152,8 +153,8 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
{
|
||||
DragAndDrop.activeControlID = controlID;
|
||||
}
|
||||
}
|
||||
|
||||
//Event.current.Use();
|
||||
}
|
||||
|
||||
private bool TryFindEntlong(Object uniObj, out entlong ent)
|
||||
|
Loading…
Reference in New Issue
Block a user