- Home /
Question by
Patrykgazing · Dec 28, 2015 at 02:21 PM ·
guifunctioneventongui
OnGUI order, function executed before OnGUIs
Hello,
I'm using Event.current.Use() to avoid GUI clicking when my "GUIAvailable" variable is false. Obviously there is always a script that calls his OnGUI before the script in which the Event.Use() is.
It's something like this:
> Some GUI script is called (Event.Use() doesn't affect it)
> Script with Event.Use() is called
> Some GUI script is called (Event.Use() is affecting now because this script is executed later)
Is there any way to use this Event.Use() before any OnGUI or to make Event.Use() script execute first? Script execution order doesn't seem to work.
The simplest way I see is to use Event.Use() at the start of OnGUI of every GUI script but I want to know if there is one global solution better than this.
Thanks in advance!
Comment