Search Unity

  1. Unity 2018.3 is now released.
    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. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    520
    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:
    661
    Senshi and karl_jones like this.
  3. Senshi

    Senshi

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