Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. 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:
    575
    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!