layout serializable objects in unity

I want to have my ModifierInfo object to show up in the inspector like a Vector3 object.

So if I have field:

[SerializeField]
private Vector3 vector;

it show up as

vector                    X [Textfield]  Y [Textfield]  Z [Textfield]

But if I do the same with my ModifierInfo:

[System.Serializable]
public class ModifierInfo {
    [SerializeField]
    public float percentOnBase;
    [SerializeField]
    public float onStack;
    [SerializeField]
    public float percentOnStack;
}

Shows up as:

▼ modifierInfo
      Percent On Base        [Textfield]
      On Stack               [Textfield]
      Percent On Stack       [Textfield]

Is it possible to change the way my object is shown in unity?

I would like to be able to use it with a list

Is it possible to change the way my object is shown in unity?

Yes it is possible. What you need is called a custom PropertyDrawer. Which is a class that you can derive from and that unity uses to draw any custom serializable class you want, (not for monobehaviours tho, for those you use a custom Editor instead since that redraws all of the properties in the script). When you’ve done it, Unity will draw your custom class the same way in every script.

Here are some links that will tell you exactly how to do it: