Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug Enum <...> has multiple entries with the same display name

Discussion in 'Unity 6 Beta' started by Rowlan, Dec 8, 2023.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,475
    I'm getting this warning for a false positive:

    Code (CSharp):
    1. Enum ImageResolutionType has multiple entries with the same display name, this prevents selection in EnumPopup.
    Because I'm using this kind of Enum:

    Code (CSharp):
    1. public enum ImageResolutionType
    2. {
    3.     [InspectorName("Game Screen")]
    4.     Game,
    5.  
    6.     // separator in enum popup
    7.     [InspectorName("")]
    8.     SEPARATOR_01,
    9.  
    10.     [InspectorName("Icon (128 x 128)")]
    11.     Resolution_Icon_128,
    12.  
    13.     // separator in enum popup
    14.     [InspectorName("")]
    15.     SEPARATOR_02,
    16.  
    17.     [InspectorName("Cubemap (128)")]
    18.     Resolution_Cubemap_128,
    19.  
    20. }
    Which is supposed to create separators like this:

    cc.png

    That warning is wrong. Or is there a new way to create separators?
     
  2. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,127
    If that's the recommended way to create separators then that's wild
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,475
    The other option is only the underscore as enum name, but that can be only used once naturally.

    I guess the dev who created that warning didn't know about the feature. Much like the rest of the Unity users. But it's definitely a good one.