AOIEntity.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. namespace ET
  4. {
  5. public class AOIEntity: Entity, IAwake<int, Vector3>, IDestroy
  6. {
  7. public Unit Unit => this.GetParent<Unit>();
  8. public int ViewDistance;
  9. public Cell Cell;
  10. // 观察进入视野的Cell
  11. public HashSet<long> SubEnterCells = new HashSet<long>();
  12. // 观察离开视野的Cell
  13. public HashSet<long> SubLeaveCells = new HashSet<long>();
  14. // 观察进入视野的Cell
  15. public HashSet<long> enterHashSet = new HashSet<long>();
  16. // 观察离开视野的Cell
  17. public HashSet<long> leaveHashSet = new HashSet<long>();
  18. // 我看的见的Unit
  19. public Dictionary<long, AOIEntity> SeeUnits = new Dictionary<long, AOIEntity>();
  20. // 看见我的Unit
  21. public Dictionary<long, AOIEntity> BeSeeUnits = new Dictionary<long, AOIEntity>();
  22. // 我看的见的Player
  23. public Dictionary<long, AOIEntity> SeePlayers = new Dictionary<long, AOIEntity>();
  24. // 看见我的Player单独放一个Dict,用于广播
  25. public Dictionary<long, AOIEntity> BeSeePlayers = new Dictionary<long, AOIEntity>();
  26. }
  27. }