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
9182e565e8
commit
7c6fdcfb6f
@ -76,16 +76,19 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
if (eventType == EventType.DragPerform)
|
if (eventType == EventType.DragPerform)
|
||||||
{
|
{
|
||||||
entlong ent = default;
|
entlong ent = default;
|
||||||
|
bool isValide = false;
|
||||||
var dragged = DragAndDrop.objectReferences[0];
|
var dragged = DragAndDrop.objectReferences[0];
|
||||||
if(dragged is GameObject go)
|
if(dragged is GameObject go)
|
||||||
{
|
{
|
||||||
if (go.TryGetComponent(out EcsEntityConnect connect))
|
if (go.TryGetComponent(out EcsEntityConnect connect))
|
||||||
{
|
{
|
||||||
ent = connect.Entity;
|
ent = connect.Entity;
|
||||||
|
isValide = true;
|
||||||
}
|
}
|
||||||
else if (go.TryGetComponent(out EntityMonitor monitor))
|
else if (go.TryGetComponent(out EntityMonitor monitor))
|
||||||
{
|
{
|
||||||
ent = monitor.Entity;
|
ent = monitor.Entity;
|
||||||
|
isValide = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -93,16 +96,18 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
if (dragged is EcsEntityConnect connect)
|
if (dragged is EcsEntityConnect connect)
|
||||||
{
|
{
|
||||||
ent = connect.Entity;
|
ent = connect.Entity;
|
||||||
|
isValide = true;
|
||||||
}
|
}
|
||||||
else if (dragged is EntityMonitor monitor)
|
else if (dragged is EntityMonitor monitor)
|
||||||
{
|
{
|
||||||
ent = monitor.Entity;
|
ent = monitor.Entity;
|
||||||
|
isValide = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long entityLong = *(long*)&ent;
|
if(isValide)
|
||||||
if(entityLong != 0)
|
|
||||||
{
|
{
|
||||||
|
long entityLong = *(long*)&ent;
|
||||||
fulleProperty.longValue = entityLong;
|
fulleProperty.longValue = entityLong;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user