public unsafe PathQueryStatus BeginFindPath(NavMeshLocation start, NavMeshLocation end, int areaMask = -1, NativeArray <float> costs = default(NativeArray <float>))
        {
            AtomicSafetyHandle.CheckWriteAndThrow(this.m_Safety);
            bool flag = !NavMeshQuery.HasNodePool(this.m_NavMeshQuery);

            if (flag)
            {
                throw new InvalidOperationException("This query has no buffer allocated for pathfinding operations. Create a different NavMeshQuery with an explicit node pool size.");
            }
            bool flag2 = costs.Length != 0;

            if (flag2)
            {
                bool flag3 = costs.Length != 32;
                if (flag3)
                {
                    throw new ArgumentException(string.Format("The number of costs ({0}) must be exactly {1}, one for each possible area type.", costs.Length, 32), "costs");
                }
                for (int i = 0; i < costs.Length; i++)
                {
                    bool flag4 = costs[i] < 1f;
                    if (flag4)
                    {
                        throw new ArgumentException(string.Format("The area cost ({0}) at index ({1}) must be greater or equal to 1.", costs[i], i), "costs");
                    }
                }
            }
            bool flag5 = !this.IsValid(start.polygon);

            if (flag5)
            {
                throw new ArgumentException("The start location doesn't belong to any active NavMesh surface.", "start");
            }
            bool flag6 = !this.IsValid(end.polygon);

            if (flag6)
            {
                throw new ArgumentException("The end location doesn't belong to any active NavMesh surface.", "end");
            }
            int  agentTypeIdForPolygon  = this.GetAgentTypeIdForPolygon(start.polygon);
            int  agentTypeIdForPolygon2 = this.GetAgentTypeIdForPolygon(end.polygon);
            bool flag7 = agentTypeIdForPolygon != agentTypeIdForPolygon2;

            if (flag7)
            {
                throw new ArgumentException(string.Format("The start and end locations belong to different NavMesh surfaces, with agent type IDs {0} and {1}.", agentTypeIdForPolygon, agentTypeIdForPolygon2));
            }
            void *costs2 = (costs.Length > 0) ? costs.GetUnsafePtr <float>() : null;

            return(NavMeshQuery.BeginFindPath(this.m_NavMeshQuery, start, end, areaMask, costs2));
        }