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)
|
||||
{
|
||||
//base.OnGUI(position, property, label);
|
||||
using (new DisabledScope(false))
|
||||
{
|
||||
EntitySlotInfo slotInfo = new EntitySlotInfo(property.FindPropertyRelative("_full").longValue);
|
||||
|
@ -1,6 +1,7 @@
|
||||
#if UNITY_EDITOR
|
||||
using DCFApixels.DragonECS.Unity.Internal;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DCFApixels.DragonECS.Unity.Editors
|
||||
{
|
||||
@ -12,6 +13,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
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.DrawRuntimeComponents(Target.Entity, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user