Many of my scripts require a global object to work. So, what I do is in the Awake() function I check if the Global object can be found with a find type call. If it can’t be found, I call LoadLevel and load the starting level that contains the Global object (which has a dont destroy call in it’s script.)
This works fine except…I have found that some objects will get into their Start() functions before others call Awake(). This is causing me to have to put the global object check (and load level check) all over the place to ensure I am catching the fact that the global object is missing.
Is there a way to easily intercept the game before anything else happens to check for the existence of the global object? It seems messy right now as I sounds and other visual things happening that aren’t caught before the global object check executes…