Hi there,
I am creating a convenience script that checks whether a scene name passed around does belong to the build or not (we’re working with several profiles) and I ran into the following issue:
The EditorBuildSettings.sceneListChanged event works, but only when there is an override on the scene list. When changing the global scenes, that event is not called.
The scenes property still works to fetch the global scenes though, but the user needs to refresh that list manually.
Is that intended behaviour? Is there a way to know when the user switches build profiles?
Another thing, while trying to work around it and force an evaluation by accessing the EditorBuildSettings.globalScenes, the compiler logs: Assets\Scripts\Utilities\ScenesList.cs(38,75): error CS0117: 'EditorBuildSettings' does not contain a definition for 'globalScenes'. Yet the field is in the documentation, even marked as public. That strikes me as a possible bug or flat out wrong doc.
Hi there!
I’ve created a bug report regarding the EditorBuildSettings.sceneListChanged issue when no overrides are present.
Regarding detection of build profile switches: we currently have a ticket to implement an OnBuildProfileChanged type of event. In the meantime, you can create a checker class to monitor the objects you want to track (Build Profiles - scriptable objects). This class could log any changes made to those objects.
What version of the editor are you using? For EditorBuildSettings.globalScenes, this feature was introduced in 6000.1.0a10 and was backported to 6000.0.36f1. To resolve this issue, I recommend upgrading to a supported version (6000.1.1f1).
Was this ever fixed? I’m currently doing something similar in Unity 6.3 and it seems that the callback still doesn’t respond to global scene list changes.
Hello! This should be fixed in:
What version are you on? I can double-check and reopen the ticket if the issue persists
My mistake! I didn’t properly initialize the listener script in the editor.
This has indeed been fixed.