     // physics geometry from the scene nodes, as it often is simpler, but if it can not find any (like in this example)
     // it will use renderable geometry instead
     navMesh.Build();
+    // Save navigation data (used for streaming only).
+    IntVector2 numTiles = navMesh.numTiles;
+    for (int z = 0; z < numTiles.y; ++z)
+        for (int x = 0; x < numTiles.x; ++x)
+        {
+            IntVector2 idx(x, z);
+            navigationTilesData.Push(navMesh.GetTileData(idx));
+            navigationTilesIdx.Push(idx);
+        }
 
     // Create the camera. Limit far clip distance to match the fog
     cameraNode = scene_.CreateChild("Camera");

    }
}

void HandleUpdate(StringHash eventType, VariantMap& eventData)
{
    // Take the frame time step, which is stored as a float


    // Create a NavigationMesh component to the scene root
    NavigationMesh@ navMesh = scene_.CreateComponent("NavigationMesh");
    // Set small tiles to show navigation mesh streaming
    navMesh.tileSize = 32;
    // Create a Navigable component to the scene root. This tags all of the geometry in the scene as being part of the
    // navigation mesh. By default this is recursive, but the recursion could be turned off from Navigable
    scene_.CreateComponent("Navigable");
