Closed i-xt closed 3 years ago
When I set the value of Exposed Scenes, does it prevent Dont Destroy On Load scene from being exposed unless I add it manually to the list (it shouldn't for this change to be merged)?
In the current implementation it does, but I guess it would make sense not to do so. From my perspective Dont Destroy On Load is a special case and should be solely controlled by m_exposeDontDestroyOnLoadScene
. I could easily update the PR. All that would be necessary is to change this line
if( !ExposeUnityScenes || (exposedScenes != null && exposedScenes.Length > 0 && System.Array.IndexOf(exposedScenes, arg0.name) == -1) )
to this
if( !ExposeUnityScenes || (arg0.buildIndex >= 0 && exposedScenes != null && exposedScenes.Length > 0 && System.Array.IndexOf(exposedScenes, arg0.name) == -1) )
Dont Destroy On Load has a build index of -1, which Unity does not allow for user created scenes, so we would just exclude all "Unity reserved scenes". Alternatively we could of course compare the scenes name, but that wouln't be my preferred solution.
Alright, I've updated the PR according to my proposed solution. If you prefer a different solution, just let me know.
I've implemented the requested changes. Should be fine now.
Thanks for the changes. I'll merge this PR as soon as possible. Sorry for the delay.
No worries. Thanks for accepting the PR.
Added the ability to filter which scenes are exposed to the hierarchy.