mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 01:54:35 +08:00
add Delete Entity button to EntityMonitor
This commit is contained in:
parent
6ad3668114
commit
1e3b5136c6
@ -11,7 +11,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
{
|
{
|
||||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||||
{
|
{
|
||||||
//base.OnGUI(position, property, label);
|
|
||||||
using (new DisabledScope(false))
|
using (new DisabledScope(false))
|
||||||
{
|
{
|
||||||
EntitySlotInfo slotInfo = new EntitySlotInfo(property.FindPropertyRelative("_full").longValue);
|
EntitySlotInfo slotInfo = new EntitySlotInfo(property.FindPropertyRelative("_full").longValue);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using DCFApixels.DragonECS.Unity.Internal;
|
using DCFApixels.DragonECS.Unity.Internal;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS.Unity.Editors
|
namespace DCFApixels.DragonECS.Unity.Editors
|
||||||
{
|
{
|
||||||
@ -12,6 +13,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
|||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI()
|
||||||
{
|
{
|
||||||
bool isAlive = Target.Entity.TryUnpackForUnityEditor(out int id, out short gen, out short worldID, out EcsWorld world);
|
bool isAlive = Target.Entity.TryUnpackForUnityEditor(out int id, out short gen, out short worldID, out EcsWorld world);
|
||||||
|
using (new EditorGUI.DisabledScope(!isAlive))
|
||||||
|
{
|
||||||
|
if (GUILayout.Button("Delete Entity"))
|
||||||
|
{
|
||||||
|
world.DelEntity(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
EcsGUI.Layout.EntityBarForAlive(isAlive ? EcsGUI.EntityStatus.Alive : EcsGUI.EntityStatus.NotAlive, id, gen, worldID);
|
EcsGUI.Layout.EntityBarForAlive(isAlive ? EcsGUI.EntityStatus.Alive : EcsGUI.EntityStatus.NotAlive, id, gen, worldID);
|
||||||
EcsGUI.Layout.DrawRuntimeComponents(Target.Entity, false);
|
EcsGUI.Layout.DrawRuntimeComponents(Target.Entity, false);
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,4 @@ namespace DCFApixels.DragonECS.Unity.Internal
|
|||||||
_entity = entity;
|
_entity = entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user