Skip to content

Commit b61b4f1

Browse files
committed
add comment + fix so model doesnt get added twice
1 parent 80cc5c6 commit b61b4f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ private static void OnPlay()
249249
return;
250250
}
251251

252+
// Right before we enter playmode, unload the last saved model if there is one.
253+
// Unsubscribe from hierarchy window changed event so that unloading the model doesn't
254+
// trigger a new one to be added right before playing.
252255
if (UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode && !UnityEditor.EditorApplication.isPlaying) {
256+
UnityEditor.EditorApplication.hierarchyWindowChanged -= UpdateLastSavedModel;
253257
UnloadModel (LastModel);
254258
LastModel = null;
255259
}

0 commit comments

Comments
 (0)