function ObjectiveCompleted ()
function DiplayGameOver ( succeed : boolean )
Something to do with the yield is causing the following error, but can someone tell me why?
BCE0070: Definition of ‘GameController.ObjectiveCompleted()’ depends on ‘Gameover_Screen.DiplayGameOver(boolean)’ whose type could not be resolved because of a cycle. Explicitly declare the type of either one to break the cycle.
Make ObjectiveCompleted explicitly return void, or make DisplayGameOver explicitly return IEnumerator, as the error says. However, if you get errors like this, you’re probably doing recursion when you shouldn’t be, so I’d recommend restructuring your code to omit the recursion instead.
In C#, coroutines (anything with yield in it) MUST use yield at least once.
I’m thinking that just adding a single yield after the loop might fix it (that’s how you fix the error C# would give you.)