TH1/Unity/Assets/Scripts/Model/Share/Module/Recast/PathfindingComponent.cs
2025-07-17 18:26:28 +08:00

32 lines
914 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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