Awhile ago, we had some huge bugs in our singleton code that was affecting a lot of people in several projects. After some investigation and speculation, we figured out the problem was that when you try to Find a singleton in Start() or Awake(), you can often find the wrong one if there were two in the first frame (such as one in the current scene and one carrying over from the last).
It was a tough problem. The instructors and student instructors didn’t seem to know how to fix it, but resorted instead to finding the singleton again whenever they needed it (because after the first frame, the second singleton should have destroyed itself back then).
I and others came up with more convoluted ways of working around the problem, which were tough to explain to new people working on their first projects.
As far as I know, it was Sam who came up with the elegant solution that worked perfectly, used concepts already taught in beginner courses, and required only one additional line of code. It was brilliant. And it helped teach some quirks of Unity.
That line simply set the object inactive before calling for it to be destroyed. This way, during that weird transition time when it hasn’t been destroyed yet, no Find or search of any kind will reference it. Instead, a Find will go to the only remaining active singleton in existence. So all your scripts trying to initialize their references on Start() or Awake() will get the correct singleton.
To be honest, this is actually more effective than destroying the singleton. Destroying the singleton after it’s been declared inactive is more of a formality and not particularly necessary.
So I’m surprised that we’ve gone back to teaching a singleton that does not deactivate itself upon discovering it’s older brethren, but instead sticks around and mucks with FindObject searches.