Your TestScript doesn't inherit from MonoBehaviour so I presume you are calling its OnGUI yourself somewhere - it needs to be called from within a real OnGUI for it to work.
↧