Topic: Waiting for Elevation before Baking NavMesh

I'm using the TilesetControl with elevation turned on to create a NavMesh that's baked at runtime. I need to wait to do so (and to spawn anything on it) until after the elevation has been reflected on the control, as it appears flat first, then pops into relief. I've tried using OnElevationUpdated(), but I'm not sure I'm using it properly.

I thought it would get called once the elevation has been reflected in the mesh, but that doesn't seem to be happening. Is that the right event, or is there another way to know when the geometry accurately reflects the elevation data? It's not entirely clear to me what is meant by "This event is called when a new elevation value received."

Thanks!

Re: Waiting for Elevation before Baking NavMesh

Hello.

This means that new elevation values has been received.
To paraphrase: the request for downloading elevation data was completed successfully.
But this does not mean that the map was redrawn.

There must be something like:

private void OnElevationUpdated()
{
    OnlineMapsTileSetControl.instance.OnMeshUpdated += OnMeshUpdated;
}

private void OnMeshUpdated()
{
    OnlineMapsTileSetControl.instance.OnMeshUpdated -= OnMeshUpdated;
    // Elevation updated and mesh redrawn.
}

Or, instead of OnlineMapsTileSetControl.OnMeshUpdated, use OnlineMaps.OnMapUpdated.
You will get the same result.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Waiting for Elevation before Baking NavMesh

Awesome, that's what I needed. Thanks.