It was a good place to start looking – I figured out what was happening, though I’m still not sure why it was happening.
//static ScoreKeeper instance;
private void Awake()
{
ManageSingleton();
}
private void ManageSingleton()
{
//if(instance != null)
int instanceCount = FindObjectsOfType(GetType()).Length;
if (instanceCount > 1)
{
gameObject.SetActive(false);
Destroy(gameObject);
}
{
//instance = this;
DontDestroyOnLoad(gameObject);
}
}
Basically, using the static version of the singleton, extra instances of objects weren’t being destroyed all the time. Testing with Debug.Logs the new instances were shown being triggered and destroyed (meaning no new object being created) every second time an object was created (Actually every second time minus 1).
If I do it without the static and based on the count method (like I originally stuck to with the AudioPlayer) everything gets destroyed just fine and the Debug. Log is triggered every time.
Obviously having multiple of these in the hierarchy just bad process, more of random luck that at first I was having the correct scorekeeper link up with the level manager since I wasn’t really aware.
The question still remains for me on why the static singleton version wasn’t working as I expected? (You can see the implementation commented out in the code above. I would really hope its something simple like a bool incorrectly put in place.)