Hi,
currently enums with the [Flags] attribute are displayed differently in the inspector, so that you are able to select multiple values. Which is great, but it would be cool to have control over this behavior.
In my scenario I have one property
“CurrentScenario” in the levelManager (so exactly one value) and then I have some objects that are only activated in certain Scenarios, these have a property “AllowedScenarios”. (so a combination of values).
Currently, I have to copy the enum, so that I have one version with “Flags” attribute and one without it
public enum ScenarioId
{
Scenario1 = 1 << 0,
Scenario2 = 1 << 1,
Scenario3 = 1 << 2,
Scenario4 = 1 << 3,
Scenario5 = 1 << 4,
}
[Flags]
public enum ScenarioIds
{
Scenario1 = ScenarioManager.ScenarioId.Scenario1,
Scenario2 = ScenarioManager.ScenarioId.Scenario2,
Scenario3 = ScenarioManager.ScenarioId.Scenario3,
Scenario4 = ScenarioManager.ScenarioId.Scenario4,
Scenario5 = ScenarioManager.ScenarioId.Scenario5,
}
It would be great to have something like
[EnumFlags] ScenarioId MultipleScenarioIds;
or the other way around
[SingleValueEnum] ScenarioIds MultipleScenarioIds;
I did find some solution with customDrawers on the internet, but they mostly suffer from not be able to work with multi-object-editing.