Need quick editor scripting help

Hello everyone.

I need quick help with something.

Say I have the following serializable type:

[Serializable]
public class RotatorItem {
    public float x, y, z;
}

In the inspector the default display is like so:

--------------------------
    [Rotator]
X                  [   ]
Y                  [   ]
Z                  [   ]
-------------------------

How would I write an editor property drawer to make the it display the members like this:

------------------------------------
    [Rotator]
X   [   ]    Y   [   ]   Z   [   ]
------------------------------------

I know it’s a lazy question but I have too much on my plate to get into learning editor scripting right now and will appreciate your help. I help a lot of people every day on various forums with Unity so I deserve it.

The lazy answer is to use a Vector3 instead. Vector3 is a struct with 3 floats anyway.

 [Serializable]
 public class RotatorItem {
     //public float x, y, z;
    public Vector3 target;
 }

If you still want a custom inspector, you just need to wrap the fields with: EditorGUILayout.BeginHorizontal and EditorGUILayout.EndHorizontal