using System; using System.Collections; using System.Collections.Generic; using Cysharp.Threading.Tasks; using BITKit.SubSystems; using UnityEngine; namespace BITKit.Mark { public interface IMarkObject { string GetID(); string GetDisplay(); Vector3 GetPostion(); bool GetAcitve(); } [SubSystemConfig(isMainThread = true)] public class MarkSystem : SubBITSystem { public Action OnAdd; public Action Update; public Action OnRemove; List markObjects = new(); public void Add(IMarkObject markObject) { markObjects.Add(markObject); OnAdd?.Invoke(markObject); } public void Remove(IMarkObject markObject) { markObjects.TryRemove(markObject); OnRemove?.Invoke(markObject); } public override void OnUpdate(float deltaTime) { foreach (var markObject in markObjects.ToArray()) { Update?.Invoke(markObject); } } } }