DragonECS-Unity/src/DebugUtils/Monitors/EntityMonitor.cs

27 lines
796 B
C#
Raw Normal View History

2025-04-16 09:36:51 +08:00
using DCFApixels.DragonECS.Unity.Editors;
using UnityEngine;
2024-03-03 19:59:39 +08:00
2024-03-10 04:56:29 +08:00
namespace DCFApixels.DragonECS.Unity.Internal
2024-03-03 19:59:39 +08:00
{
2024-03-10 04:56:29 +08:00
[MetaColor(MetaColor.Gray)]
2024-06-13 18:04:47 +08:00
[MetaGroup(EcsUnityConsts.PACK_GROUP, EcsConsts.DEBUG_GROUP)]
[MetaDescription(EcsConsts.AUTHOR, "...")]
[MetaTags(MetaTags.HIDDEN)]
2025-03-19 16:31:32 +08:00
[MetaID("DragonECS_A551B6809201D56AA0F1B51248174B4D")]
2024-03-10 06:19:20 +08:00
internal class EntityMonitor : MonoBehaviour
2024-03-03 19:59:39 +08:00
{
private entlong _entity;
2024-03-10 04:56:29 +08:00
public entlong Entity
2024-03-03 19:59:39 +08:00
{
2024-03-10 04:56:29 +08:00
get { return _entity; }
2024-03-03 19:59:39 +08:00
}
2024-03-10 04:56:29 +08:00
public void Set(entlong entity)
2024-03-03 19:59:39 +08:00
{
_entity = entity;
2025-04-16 09:36:51 +08:00
#if UNITY_EDITOR
var world = entity.GetWorldUnchecked();
world.Get<EcsGUI.EntityLinksComponent>().SetMonitorLink(entity.GetIDUnchecked(), this);
#endif
2024-03-03 19:59:39 +08:00
}
}
}