Search Unity

Bug Enum:byte element with max value (0xFF or 255) shows up as blank in the Inspector

Discussion in 'Editor & General Support' started by ToxicCherry, Dec 28, 2020.

  1. ToxicCherry

    ToxicCherry

    Joined:
    Oct 27, 2016
    Posts:
    3
    Code (CSharp):
    1. public enum SomeEnum : byte
    2. {
    3. EnumValue0 = 0x0,
    4. EnumValue1 = 0x1,
    5. EnumValue255 = 0xFF,
    6. }
    7.  
    8. // In SomeClass : MonoBehaviour
    9. public SomeEnum MyEnumValue = SomeEnum.EnumValue255;
    The enum field created in the Inspector shows up with no text in the value section. When I click on the dropdown and manually select EnumValue255, it switches to EnumValue0 instead, and keeps doing so no matter how many times I try to select EnumValue255.

    I'm very new to Unity, so I'm not sure if this is some kind of intended feature for enums in the Unity Inspector. Can someone confirm it? Much appreciated.
     
    Last edited: Dec 28, 2020
    morhun_EP likes this.
  2. morhun_EP

    morhun_EP

    Joined:
    May 11, 2021
    Posts:
    9
    Still happening in Unity 2020.3.11f1.