Hello! Iām looking for a way to restart everything in a scene when it reaches the end. In Unity Iād do that by simply calling āLoadSceneā and give it the current sceneās index, and I took a look at the SceneSwitcher sample to try the same approach, but it doesnāt look like the SceneSwitcher script supports this just yet. In a pinch, I can just refresh the pageā¦ but is there a better way?
I think you could unassign and re-assign the needle-engine src to dispose and recreate everything which might or might not be expensive depending on your scene complexity (and I think you have quite some heavy models that take a moment to be setup, not even the loading part but building the scene)
The SceneSwitcher could be used for that on a sub-scene level altough it doesnt have a method for āreloadā (and it doesnt load the same scene again if you call with the same name or index) - it would result in the same thing tho - the subscene objects would all be re-created which would not be ideal.
If you ask for the project Iām thinking about then I would rather keep track of the relevant state in a script of yours that does the resetting to avoid rebuilding the whole scene.
that sounds wise, thanks!! either of these approaches sounds much better than just a page refresh, so weāll probably give the dispose-and-recreate approach a try, and then settle for a (riskier?) state approach if that doesnāt meet our needs. All set for now, then!