Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

ReorderableList.list returns null in some Inspectors

Discussion in 'Extensions & OnGUI' started by Senshi, May 24, 2018.

  1. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    516
    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:
    637
    Senshi and karl_jones like this.
  3. Senshi

    Senshi

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