Question by
NBerny · Nov 07, 2018 at 03:32 PM ·
navmeshnavigationcomparesame
Compare NavMeshSurfaces with each other
Hi everyone!
I want to compare a NavMeshSurface with itself and want to know about if it changes.
Ich have an editor script with a button that calls the following function:
public virtual bool HasNavMeshSurfaceChanged(NavMeshSurface surface)
{
var oldSurfaceData = surface.navMeshData;
surface.BuildNavMesh();
if (oldSurfaceData == surface.navMeshData)
{
Debug.Log("same");
return false;
}
else
{
Debug.Log("not same");
return true;
}
}
I predicted, that when I move an object in scene that effects the NavMeshSurface Generation and rebake the NavMeshSurface, the navMeshData would change. That does not seem to be the case, because the navMeshData seems to change every time the NavMeshSurface gets rebaked, even if I change nothing in the scene.
The NavMeshSurface itself updates correctly to the movement of the object.
Is there a different opportunity to compare a NavMeshSurface with itself after rebake?
Thank you very much! =)
Comment