dbrizov / NaughtyAttributes

Attribute Extensions for Unity
MIT License
4.55k stars 467 forks source link

[Request] Inline struct editor #324

Open rhys-vdw opened 2 years ago

rhys-vdw commented 2 years ago

Would be nice to have a simple attribute that automatically inlines a struct editor instead of requiring user to fold it out. (i.e. draws it as if the fields belong to the owning inspector.)

TylerTemp commented 7 months ago

For ppl who are still expecting this feature, I have a util for a Serializable target (struct, class, etc) that allows it to be displayed "inline".

The project can work together with NaughtyAttributes, but note after applying this attribute, the Serializable target can no longer use meta attributes from NaughtyAttributes (normal PropertyDrawer attrubutes from NA still work):

[Serializable]
public struct MyStruct
{
    public int structInt;
    public bool structBool;
}

[SaintsRow(inline: true)]
public MyStruct myStructInline;

public string normalStringField;

saints_row_inline