I’ve got a GameManager singleton that persists through all my scenes. It’s got a LoadLevel() function in it which needs to be called when certain uGUI buttons are clicked on in various scenes.
I’m running into two issues:
a. Mapping the buttons OnClick() via the editor needs to have a valid GO with the GameManager script on it. I can do that, but then…
b. The GameManager class can be instantiated in a different scene. When the new Scene loads with another GameManager already instantiated, the original GameManager detects the new Scenes GameManager and Destroys() it so there is only one in the scene. This, of course, buggers up the OnClick() event of the button which was mapped to the GO which was just destroyed.
Any suggestions on how to get around this?