PathfindingComponent.cs 914 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using DotRecast.Core;
  4. using DotRecast.Detour;
  5. namespace ET
  6. {
  7. /// <summary>
  8. /// 同一块地图可能有多种寻路数据,玩家可以随时切换,怪物也可能跟玩家的寻路不一样,寻路组件应该挂在Unit上
  9. /// </summary>
  10. [ComponentOf(typeof(Unit))]
  11. public class PathfindingComponent: Entity, IAwake<string>, IDestroy
  12. {
  13. public const int MAX_POLYS = 256;
  14. public const int FindRandomNavPosMaxRadius = 15000; // 随机找寻路点的最大半径
  15. public RcVec3f extents = new(15, 10, 15);
  16. public string Name;
  17. public DtNavMesh navMesh;
  18. public List<long> polys = new(MAX_POLYS);
  19. public IDtQueryFilter filter;
  20. public List<StraightPathItem> straightPath = new();
  21. public DtNavMeshQuery query;
  22. }
  23. }