Hi,
I guess it’s been covered many times already, but I can’t really find a solution in Unity Answers or the Forum or Google.
I’m looking for a metod or scrap of code that allow me to get a result comparable to GameObject.Find and GameObject.FindObjectsOfType that also takes into account disabled objects or components in the scene hierarchy.
I saw there are the “All” alternatives to these methods, but I don’t know how to mask their results to only get objects in the scene.
Premise:
I need to use these in a persistent singleton which also executes in editor mode, so I can’t assign objects or references by hand. I get all the references on the Awake method.
Also, the game designer could forget to enable certain objects before saving the scene, and I still haven’t found a way to enable the relevant object before saving.
Please also note that this Singleton (which is actually one of the different managers on a persistent gameobject) is only available during scene creation and it will be removed (or deleted by a previously existing singleton of the same type) when saving the final version of the scene. It gets added to each scene just to help the level designer.
Could you please help me?