title: Unity custom editor error "type is not a supported int value"
body: <p>I was making my own custom script editor with <code>SerializedProperty</code> variables, but I got the following error:</p>
  
  <pre><code>type is not a supported int value
  UnityEditor.SerializedProperty:get_boolValue()
  </code></pre>
  
  <p>The reason why I was using <code>SerializedProperty</code> variable types is that I use the script on a prefab, which would cause some trouble with overriding parameters.</p>
  
  <p>Here is my editor script:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using UnityEditor;
  using UnityEngine;
  using sp = UnityEditor.SerializedProperty;
  
  [CustomEditor (typeof (ScriptName))]
  public class SwitchableObjectEditor : Editor {
  
      SerializedProperty usePanel, morningHint;
  
      protected virtual void OnEnable () {
          usePanel = serializedObject.FindProperty ("morningHint");
          morningHint = serializedObject.FindProperty ("morningHint");
      }
  
      public override void OnInspectorGUI () {
          if (UnityEditor.EditorApplication.isPlaying)
              return;
          ScriptName s = (ScriptName) target;
  
          usePanel.boolValue = EditorGUILayout.Toggle (usePanel.boolValue);
          morningHint.stringValue = EditorGUILayout.TextArea (morningHint.stringValue);
          this.serializedObject.ApplyModifiedProperties ();
      }
  }
  </code></pre>
  
  <p>I was frustrated, because the morningHint variable worked nicely.</p>