Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it 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. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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

Reorderable List v2

Discussion in 'Extensions & OnGUI' started by CDF, Jul 9, 2015.

  1. YaserDev

    YaserDev

    Joined:
    Aug 17, 2016
    Posts:
    17
    Hello.
    I have added the package to my project, but I can't use the directory Malee, it says it's not found.
    I have tried adding a reference to it in visual studio, by right-clicking the project assembly, then AddReferernce, but I get an error when I try to add the Rotorz package that says it can't be added, without any other message.
    Has anyone faced such a problem?
    Thanks
    (Nevermind: Turns out Malee is not the directory of the package itself, but it was in the example on git hub, I used it before but accidentally deleted the folder)
     
    Last edited: Mar 16, 2018
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    640
    Hey just a small update here, I've added some new features to the ReorderableList:

    pagination - ability to separate the list into pages, helpful if you're dealing with massive lists
    sorting - ability to sort list based on a field, or the value of each element
    custom label per element - "getElementLabelCallback"

    Let me know what you think, and any bugs you might find :)
     
    alexanderameye likes this.
  3. ferdielance

    ferdielance

    Joined:
    May 31, 2018
    Posts:
    1
    I just discovered this library and it's working perfectly. I was trying to display a list of objects with various custom drawers, and nothing else worked smoothly; this made my life much easier. Thanks a lot!
     
  4. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    736
    Hey, is there a way to know if a certain list element was selected and return it as a Boolean in code?

    Thanks in advance,

    Alex
     
  5. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    640
    You can get selection indices and loop over:

    Code (CSharp):
    1. var selected = list.Selected;
    2.  
    3. foreach (int index in selected) {
    4.  
    5.     var element = list.GetItem(index);
    6. }
     
    alexanderameye likes this.