Pause game but GUI still work?

I think OnGUI and Update are the same thread in application,
So,How to pause game but OnGUI function still work?
Thanks…

in order to pause your game use : Time.timeScale = 0

Time.timeScale = 1 , to resume.