Hi Nina,
Thanks for getting back so fast.
There are no errors in the Console, which is surprising (that was the first place I looked).
However, after a 2 hour break, I’m doing a bit more testing now.
The OnClick()'s both have methods when the game is not running, and each one has a method if I run the game from that scene, but I just found out, that when I click through (i.e. if I run the game from the Start Screen, and click to get to the Options Screen), the second scene is missing it’s OnClick() method (from which ever scene I start the game from).
As a test, I ran the game from the Start Screen. Before I clicked on the Options button, it looked like this:
After I clicked on the Options button, it went to the Options Screen, and it looked like this:
And, not surprisingly, the Back button doesn’t work.
I stopped the game, and with the game not running, and the Options Screen looks like this:
So, it appears to have removed the OnClick() method when it loaded the scene. Which ever scene is loaded by the game (the second scene) is missing it’s OnClick() method.
The singleton pattern appears to be working, since the LevelLoader is listed under DontDestroyOnLoad, but just in case I’ve missed something, here’s that code:
private void Awake()
{
// SINGLETON PATTERN:
int gameStatusCount = FindObjectsOfType<LevelLoader>().Length;
if (gameStatusCount > 1)
{
gameObject.SetActive(false);
Destroy(gameObject);
}
else { DontDestroyOnLoad(gameObject); } // if there is not one already, don't destroy "when the level loads in the future" - Rick Davidson.
}
If you have any other ideas, or if you have more questions, please let me know.
Thank you,
Jim