private bool ProcessTriangleForHierarchy(MyNavigationTriangle triangle) { // The triangle parent can be wrong when we have multiple navmeshes connected via external edges if (triangle.Parent != m_mesh) { return(false); } if (m_tmpCellTriangles.Contains(triangle.Index)) { m_components.AddComponentTriangle(triangle, triangle.Center); m_tmpComponentTriangles.Add(triangle); return(true); } else { ulong cellIndex; // This test succeeds only if the triangle belongs to an unchanged component or to a component that was changed, // but processed in a different cell already if (m_components.TryGetComponentCell(triangle.ComponentIndex, out cellIndex)) { // Save connections to other components. There won't be so many, so we can keep them in a list instead of a HashSet if (!m_currentCellConnections[m_currentComponentRel].Contains(triangle.ComponentIndex)) { m_currentCellConnections[m_currentComponentRel].Add(triangle.ComponentIndex); } } } return(false); }