Not correct OnGUI documentation

All other events are processed first, then the repaint event is sent.

But my test showed me another!


Layout 0

Repaint 1

Layout 2

mouseDrag 3

Layout 4

KeyUp 5

Layout 6

mouseDrag 7


Repaint event are processed first, then the Other events is sent.

My Code:

int V = 0;
void Update () {
    V = 0;

void OnGUI() {
    Debug.Log(Event.current.type.ToString() + " "+ V);


Your interpretation of your results is just wrong ^^. Update is also called quite late during the frame. Since you check from Update to Update you get the wrong picture. Try adding Time.frameCount to each Debug.Log and you see which call belongs to which frame.

The OnGUI Repaint event is literally the last thing that is executed each frame. I think the only thing that came after is WaitForEndOfFrame coroutines.

You might want to take a look at the flowchart over here. That chart is very simplified and doesn’t cover everything, but the over-all structure should be correct.