using System.Collections.Generic; using Unity.Mathematics; namespace ET.Server { [ComponentOf(typeof(Unit))] public class AOIEntity: Entity, IAwake, IDestroy { public Unit Unit => this.GetParent(); public int ViewDistance; public Cell Cell; // 观察进入视野的Cell public HashSet SubEnterCells = new HashSet(); // 观察离开视野的Cell public HashSet SubLeaveCells = new HashSet(); // 观察进入视野的Cell public HashSet enterHashSet = new HashSet(); // 观察离开视野的Cell public HashSet leaveHashSet = new HashSet(); // 我看的见的Unit public Dictionary SeeUnits = new Dictionary(); // 看见我的Unit public Dictionary BeSeeUnits = new Dictionary(); // 我看的见的Player public Dictionary SeePlayers = new Dictionary(); // 看见我的Player单独放一个Dict,用于广播 public Dictionary BeSeePlayers = new Dictionary(); } }