title: How can I set position of a GUI.Button in Inspector?
body: <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEditor;
  using UnityEditorInternal;
  using UnityEngine;
  
  [CustomEditor(typeof(ConversationTrigger))]
  public class ConversationTriggerEditor : Editor
  {
      private ConversationTrigger conversationtrigger;
  
      private void OnEnable()
      {
          conversationtrigger = FindObjectOfType&lt;ConversationTrigger&gt;();
      }
  
      public override void OnInspectorGUI()
      {
          DrawDefaultInspector();
  
          if(GUI.Button(new Rect(0.1f,0.5f,0.1f,0.1f), "Add new item"))
          {
              conversationtrigger.conversations.Add(new Conversation());
          }
  
          if (GUILayout.Button("Save Conversations"))
          {
              conversationtrigger.SaveConversations();
          }
  
          if (GUILayout.Button("Load Conversations"))
          {
              Undo.RecordObject(conversationtrigger, "Loaded conversations from JSON");
              conversationtrigger.LoadConversations();
          }
      }
  }
  </code></pre>
  
  <p>I tried this line :</p>
  
  <pre><code>if(GUI.Button(new Rect(0.1f,0.5f,0.1f,0.1f), "Add new item"))
  </code></pre>
  
  <p>But that make the button vanished like deleted.
  If I'm using <code>GUILayout.Button</code> I will see the button but then I can't set the button position so I'm using <code>GUI.Button</code>.</p>
  
  <p>I want to position the button <code>"Add new item"</code> before the <code>Canvas</code> field and always after the last conversation item, in this case the Locked Room. And if I will add a new item the button should  stay after the new added item and before the <code>Canvas</code> field.</p>
  
  <p>I guess this values of the <code>Rect</code> are wrong making the button to be positioned out of the window.</p>
  
  <p>This is a screenshot of the Inspector :</p>
  
  <p><a href="https://i.stack.imgur.com/yVShF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yVShF.jpg" alt="Inspector"></a></p>