From 7c6fdcfb6f5e1c78f8d68220926332caa60a4a95 Mon Sep 17 00:00:00 2001 From: DCFApixels <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:51:52 +0800 Subject: [PATCH] Update EntlongDrawer.cs --- src/DebugUtils/Editor/EntlongDrawer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DebugUtils/Editor/EntlongDrawer.cs b/src/DebugUtils/Editor/EntlongDrawer.cs index e8ce676..a5a25f2 100644 --- a/src/DebugUtils/Editor/EntlongDrawer.cs +++ b/src/DebugUtils/Editor/EntlongDrawer.cs @@ -76,16 +76,19 @@ namespace DCFApixels.DragonECS.Unity.Editors if (eventType == EventType.DragPerform) { entlong ent = default; + bool isValide = false; var dragged = DragAndDrop.objectReferences[0]; if(dragged is GameObject go) { if (go.TryGetComponent(out EcsEntityConnect connect)) { ent = connect.Entity; + isValide = true; } else if (go.TryGetComponent(out EntityMonitor monitor)) { ent = monitor.Entity; + isValide = true; } } else @@ -93,16 +96,18 @@ namespace DCFApixels.DragonECS.Unity.Editors if (dragged is EcsEntityConnect connect) { ent = connect.Entity; + isValide = true; } else if (dragged is EntityMonitor monitor) { ent = monitor.Entity; + isValide = true; } } - long entityLong = *(long*)&ent; - if(entityLong != 0) + if(isValide) { + long entityLong = *(long*)&ent; fulleProperty.longValue = entityLong; }