I have been working on creating an editor extension and I am getting the hang of it fairly good. My problem I currently have and can not find the solution to is when creating editor buttons they stack down wards one below the next. I want to make it so that at least two of the buttons are on the same line. Here is the code as I have it now.
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(ObjectBuildingScript))]
public class ObjectBuilderEditor : Editor {
private Texture2D m_Logo = null;
public override void OnInspectorGUI()
{
DrawDefaultInspector();
m_Logo = (Texture2D)Resources.Load("y",typeof(Texture2D));
ObjectBuildingScript myScript = (ObjectBuildingScript)target;
if(GUILayout.Button(m_Logo,GUILayout.Width(70),GUILayout.Height(70)))
{
myScript.BuildObject();
}
if(GUILayout.Button(m_Logo,GUILayout.Width(70),GUILayout.Height(70)))
{
myScript.BuildObject();
}
if(GUILayout.Button(m_Logo,GUILayout.Width(70),GUILayout.Height(70)))
{
myScript.BuildObject();
}
}
}