Search Unity

Bug Nested classes in Inspector don't render properly in 2020 where they did in 2019

Discussion in 'Editor & General Support' started by SoftwareGeezers, Sep 1, 2022.

  1. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    I have a couple of nested classes exposed in the Inspector. These used to work in 2019. However, it seems in 2020 to be broken as the expanded views just overlap...

    upload_2022-9-1_19-43-58.png

    Code (CSharp):
    1.  
    2. public class Modifier {
    3.    public static uint modCount;
    4.    [Tooltip("MUST BE UNIQUE PER MOD")]
    5.    public string id;
    6.    public uint hash_mod;
    7.    public EFFECTS effect;
    8.    public EFFECT_APPLICATION_TYPE type;
    9.    public float amount;
    10.    public float duration;
    11.    [Tooltip("If effect restored to original when mod ends")]
    12.    public bool isTemporary;
    13. ...
    14. }
    15. public class InteractionDefinition {
    16.    public static uint defCount;
    17.    [HideInInspector]
    18.    public uint hash_interDef;
    19.    public INTERACTION_TYPE type;
    20.    public float proximity = 3;
    21.    public TRIGGER_TYPE trigger;
    22.    public ENTITY_TYPE[] appliesTo;
    23.    [SerializeField]
    24.    public Modifier[] effectModTarget;
    25.    [SerializeField]
    26.    public Modifier[] effectModSelf;
    27.    public Entity.LIFE_STATE terminationState = Entity.LIFE_STATE.none;
    28. }
    29.  
    30.     [Header("Interactions")]
    31.    public InteractionDefinition[] interDefinitions;
    32.  
    How can I fix this? It's essential to be able to modify the gameobjects this way.

    Edit: Was a bug apparently fixed in 2020.3.7f1. However I'm on LTS 2020.3.35f1 so this is supposed to be fixed?

    https://issuetracker.unity3d.com/is...is-overlapping-in-the-inspector-when-expanded

    Edit2: This solution works:

    https://answers.unity.com/questions/1828499/nested-class-lists-inspector-overlapping-bug.html

    Add the [NonReorderable] Attribute to disable the reorderable list rendering. I guess this was a new Inspector feature added and it's still dodge.
     
    Last edited: Sep 1, 2022
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,726
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    There is also https://issuetracker.unity3d.com/is...n-for-arrays-that-use-custom-property-drawers Fixed in 2020.3.37 not 2020.3.7 . 2020.3.7 is probably a typo. Having the same bug fix applied to 2020.3.7 and 2021.3.5 doesn't make much sense since there should be roughly a year between them and at the time of 2021.3.5 was released 2020 series was already past 2020.3.36. Or maybe there was regression somewhere in the middle of 2020.3.30 range so it had to be fixed again, hence the second issue fixing it in 2020.3.37.
     
  4. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    Oh okay. Just checked and for some reason I'm not updated to the latest, .38.