title: Unity resets parameter value set with Editor script on play
body: <p>I've set up a very simple Editor script in Unity 2020.2.1f1 that, upon pressing an Inspector button, should change the value of a specified parameter to a value set in the code.</p>
  <pre><code>public override void OnInspectorGUI()
  {
      DrawDefaultInspector();
  
      StateObject s = (StateObject)target;
      if (s.objID == 0)
      {
          if (GUILayout.Button(&quot;Generate Object ID&quot;))
          {
              GenerateID(s);
          }
      }
  }
  
  public void GenerateID(StateObject s)
  {
      s.objID = DateTimeOffset.Now.ToUnixTimeSeconds();
  }
  </code></pre>
  <p>This all works like it's supposed to. I press the button, the correct number appears in the field, and I'm happy. However, once I switch to Play mode, the value resets to the prefab default and remains that way even when I switch Play mode off.</p>
  <p>Am I missing some ApplyChange function or something?</p>