I have been working on a driving game and its almost finished. I'm just trying to add some polishing touches. Ironically this part im stuck on now would not have been any issue at all in purely code based frameworks i used before (LibGDX/Xna) because I could just make a boolean that's called ReadyToPlay or something and just put that around all the code i want to wait to start.
I've made a secondary camera which rotates around the players car, it works fine but my problem is that the GUI is also already loading AND the race start countdown occurs still whilst the camera is still spinning.
I'm not sure in Unity how to go about stopping that to allow the time for the camera to spin.
One idea I have to fix this (i'm checking first because this doesnt seem right to me) is to use the yield routine in the GUI loading script and tell it exactly how many seconds the camera is going to spin for. I'd rather have just have the camera detected when its done a full spin and then make a boolean true, or trigger another method to start the game properly.
I promise I have done some research trying to find ways but the only thing i can find except yield, is Monobehaviour.Invoke but the invoke method still requires me to specify the time.
The whole strategy for yield or invoke feels wrong to me. I guess my main problem is that the code is spread over a few scripts, instead of being funneled thru a main.cs and then gameManager.cs etc etc so theres no way (that I know) to break the chain higher up. I'd have to add bools to each script to say isLuxuryCameraAlive and that still seems wrong to me as I might have 5-10 scripts and have to also section of bits of code in each script.
How would you experienced programmers attack this issue??