Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

ReorderableList.list returns null in some Inspectors

Discussion in 'Immediate Mode GUI (IMGUI)' started by Senshi, May 24, 2018.

  1. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    So here's another fun one,

    I'm creating some custom inspectors for an asset I'm creating and in some of them ReorderableList.list always returns null, even though it I'm sure exists. I can add and remove items, and even log the correct ReorderableList.count. I've tried accessing it in OnGUI(), during creation and inside the custom click handlers; all nada. Again though, this is only for ReorderableLists on some components; others work just fine.

    So... what gives? Is there some quirk I'm missing?
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    971
    Senshi and karl_jones like this.
  3. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Aaaah, that makes sense! I just figured the list property would be an implicit getter to the underlying list or something. Thank you for the clarification!
     
unityunity