Hello!
I’ve been poking around Unity for fun, trying to customize the inspector of my gameplay scripts, but when it comes to enums, I can’t seem to be able to remove the “Everything”, “Nothing” options from there. Is there a way to disable the “mixed” mode and force the inspector to just allow the user to select one value? The default inspector has no problem with that so I guess it’s doable.
My enum
public enum PowerUpType
{
NONE = 0,
SPEEDBOOST = 1,
FUEL = 2,
JUMPBOOST = 3
}
My OnInspectorGUI()
public override void OnInspectorGUI()
{
PowerUps powerup = target as PowerUps;
powerup.PowerupType = (PowerUpType)EditorGUILayout.EnumMaskField("PowerupType",powerup.PowerupType);
}
Unwanted result:
All I want there is the options on my enum, nothing else, not sure where those values are coming from or how to remove them.
PS: I’m a seasoned C# programmer, but this is my first time trying to modify the inspector so please be gentle
PS2: I did search google and this forum and couldn’t find anything as to how to disable mixed mode, I tried setting showMixedValue to false but to no avail.
Thanks!!