void OnDisable () {
registered = false;
if (_dynamic) {
dynamicMeshObjs.Remove (this);
} else {
if (!tree.Remove (this)) {
throw new System.Exception ("Could not remove RecastMeshObj from tree even though it should exist in it. Has the object moved without being marked as dynamic?");
}
}
_dynamic = dynamic;
}
}