AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.4k stars 289 forks source link

EditorHintCategory-Attribute for Properties #754

Open ChristianGreiner opened 4 years ago

ChristianGreiner commented 4 years ago

Summary

I think it would be useful, if you could group properties of a single class, especially when you have many properties.

At the moment, the EditorHintCategory-Attribute is only available for classes.

Example:

// This is a Resource File

[EditorHintRange(0, 1000)]
public float Mass { get; set; } = 300f;

public SpaceshipType Type { get; set; } = SpaceshipType.Multipurpose;

[EditorHintCategory("Sound")]
public ContentRef<Sound> AmbientSound = new ContentRef<Sound>();

[EditorHintCategory("Sound")]
public ContentRef<Sound> EngineSound = new ContentRef<Sound>();

The grouped "Sound"-Properties could stored in the "Spoiler"-Like-Control....

image

What do u think?

ilexp commented 4 years ago

Great idea, I think this would be a nice "quality of life" improvement on the editor. A couple of points: