- Home /
Question by
vishesh-l · Apr 01, 2016 at 06:25 AM ·
c#unity 5unityeditor
OnGUI call caused Cardboard Editor Scripts Errors
so my project was working fine until i made an OnGUI call from a script. Now im getting 2 errors from cardboardAudioListener - Actually the Cardboard Audio Listener Editor Script
Assets/Cardboard/Editor/CardboardAudioListenerEditor.cs(46,9): error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'
and
Assets/Cardboard/Editor/CardboardAudioListenerEditor.cs(48,9): error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'
These errors persist even after i deleted the script which was calling OnGUI().
Unity: 5.3.3
Actually if i comment out the lines the same lines in another cardboard editor script cause the error -
GUI.enabled = !EditorApplication.isPlaying;
EditorGUILayout.PropertyField(quality, qualityLabel);
GUI.enabled = true;
So i renamed the Editor Folder inside Cardboard Folder for disabling the editor scripts. Now it works but i'm not able to edit the cardboard properties.
How do i restore it so that the editor scripts work?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612073952im_/https://answers.unity.com/themes/thub/images/avi.jpg)