I've been trying to get a GUI system to work using yield (which is, or at least should be, much easier than the alternatives), except that none of my code seems to be working. Come to think of it, I can see the problem with this approach (nothing would be displayed continuously without a loop or something to make it stay in place). Nevertheless, the odd part is that not a single line of code is working on any method that I call from OnGUI() that contains a yield statement, including debug code.
EG:
def OnGUI ():
Debug.Log("This works")
if GUILayout.Button("First button"):
Debug.Log("Pushed first button")
Test()
def Test ():
Debug.Log("But neither this")
if GUILayout.Button("Nor this"):
yield
GUILayout.Label("Nor this")
Debug.Log("Nor this works")
This has become.... quite frustrating.
I guess it will be back to the drawing board with xml and parsers if I can't get this scripting solution to work. (It's for a conversation system, btw. I thought, why bother with more arrays and data languages if I can get it to work just using scripts? Much simpler; more powerful... now this).