public static IEnumerable <NavCellController> GetCellsInBounds(Bounds bounds, NavigationMesh mesh) { foreach (var element in NavMeshCell.GetCellsInBounds(mesh, bounds)) { yield return(element.controller); } }
public void Invalidate() { foreach (var cell in containingCells) { cell.Invalidate(); } containingCells = new List <NavMeshCell>(); var collider = gameObject.GetComponent <Collider>(); foreach (var cell in NavMeshCell.GetCellsInBounds(NavigationMesh.mainMesh, collider.bounds)) { containingCells.Add(cell); cell.Invalidate(); } }