Mam problem z błędem CS0116 w tym skrypcie

OnGUI was placed outside the class, move it.
Also for the future: