public static void RequestPath(Vector3 _startPos, Vector3 _endPos, Action <Vector3[], bool> _callback) { SPathRequest request = new SPathRequest(_startPos, _endPos, _callback); m_Instance.m_PathRequestQueue.Enqueue(request); m_Instance.TryFindNextPath(); }
//public void FinishedSearchingForReachableArea(Vector3[] _area, bool _success) //{ // m_CurrentReachableAreaRequest.m_Callback(_area, _success); // m_IsSearchingForReachableArea = false; // TryDefineReachableArea(); //} void TryFindNextPath() { if (!m_IsSearchingForPath && m_PathRequestQueue.Count > 0) { m_CurrentRequest = m_PathRequestQueue.Dequeue(); m_IsSearchingForPath = true; m_Pathfinding.StartFindPath(m_CurrentRequest.m_StartPos, m_CurrentRequest.m_EndPos); } }