Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    557
    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:
    1,306
  3. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    557
    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!