I'm in the process of writing a script that will merge scenes with the option of removing duplicate GameObjects. The idea is to open a scene with EditorApplication.OpenSceneAdditive, and then check if any newly loaded GameObjects share the same name as other GameObjects in the scene.
How can we determine the list of GameObjects that have been loaded with OpenSceneAdditive? Perhaps there is some method we can call in OnHierarchyChange?
Edit: The approach I've decided to take is to get all GameObjects with GameObject.FindObjectsOfType(typeof(GameObject)); before and after the merge, and then comparing them to find the newly added GameObjects.
↧