Well, five years later, and there doesn’t seem to have been any resolution on this. It’s happening to me, in version 3.5, but, as others have noted, doesn’t seem to have any negative impact.
Still, I’d like to understand why it’s happening and clean it up.
It’s infrequent and I can’t reproduce it but every now and then it pops up … I think it’s because it’s in OnEnable(); I’ve ran into issues with it before but I’m guessing it has to do with OnEnable()'s execution order. I have a singleton class that has “DontDestroyOnLoad” and OnEnable and OnDisable always get called twice. It’s strange because I’ll put a bool in there so it will only run once but it still runs it twice. Each time setting the bool to false and completely “ignoring” the check. Whatever I’m passed it…
Aww crap it wasn’t OnEnable it was OnLevelWasLoaded that it was calling it twice on my DontDestroyOnLoad gameobject… But the OP’'s error was from OnEnable and the code snippet from my previous post. The execution order is a little more complex depending on the situation: