LoadScene causes existing GameObjects to be destroyed by default. timeline and friends depend on the existence of a particular GameObject (-mono-obj).
Thus if LoadScene is used in a timeline, the timeline ends at that point (i.e. subsequent iterations do not occur).
By using DontDestroyOnLoad, -mono-obj can be made to persist across a scene load. This enables use of more than one use of LoadScene in a timeline, e.g.:
(timeline
[#(log "loading first scene")
#(SceneManager/LoadScene "title")
#(log "loaded first scene, now waiting")
(wait 2.0)
#(log "waited...now loading next scene")
#(SceneManager/LoadScene "play")
#(log "loaded scene...have fun :)")])
LoadScene causes existing GameObjects to be destroyed by default. timeline and friends depend on the existence of a particular GameObject (-mono-obj).
Thus if LoadScene is used in a timeline, the timeline ends at that point (i.e. subsequent iterations do not occur).
By using DontDestroyOnLoad, -mono-obj can be made to persist across a scene load. This enables use of more than one use of LoadScene in a timeline, e.g.:
```clojure
(timeline
[#(log "loading first scene")
#(SceneManager/LoadScene "title")
#(log "loaded first scene, now waiting")
(wait 2.0)
#(log "waited...now loading next scene")
#(SceneManager/LoadScene "play")
#(log "loaded scene...have fun :)")])
```
LoadScene causes existing GameObjects to be destroyed by default. timeline and friends depend on the existence of a particular GameObject (-mono-obj).
Thus if LoadScene is used in a timeline, the timeline ends at that point (i.e. subsequent iterations do not occur).
By using DontDestroyOnLoad, -mono-obj can be made to persist across a scene load. This enables use of more than one use of LoadScene in a timeline, e.g.: