I don’t totally understand why we’re using a singleton in this context.
From what I can see, the ‘music player’ (on which our audio source sits) is instantiated once, and only once, each time the scene restarts.
I understand that the music restarts when the player dies (which we’re wanting to avoid) - however, the ‘music player’ doesn’t appear to duplicate on each scene restart.
To put it another way: for a singleton pattern to be necessary, I’d have expected to see an additional ‘music player’ appearing in the heirarchy each time the scene restarted - so after 3 x scene restarts, we’d have 3 x music players, etc. (But this isn’t the case.)
So, why the need for the singleton pattern?
Many thanks