Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to feed simple list of strings data into list view controller for a workspace

Discussion in 'EditorXR' started by bss_shashankk, May 8, 2018.

  1. bss_shashankk

    bss_shashankk

    Joined:
    May 8, 2018
    Posts:
    4
    Hi Guys,

    I am trying to create custom workspace which simply displays list of strings with scroll functionality.

    I looked at HierarchyWorkspace and ProjectWorkspace examples and notice that both use interfaces IUsesHierarchyData, IUsesFolderData from respective modules to setup the data.

    So was wondering what is the best way to set up list of strings data for a class which is derived from listviewcontroller? I did look at list view open source on bitbucket which is straight forward, however listview code is modifed a little in EditorXR source code with additional types.

    It would be great if someone can give an input on implementing it.

    Thanks!
     
  2. amirebrahimi_unity

    amirebrahimi_unity

    Joined:
    Aug 12, 2015
    Posts:
    400
    You probably don't notice this now, but might when the editor gets packaged into separate DLLs with assembly definition files - we don't actually make the interfaces or listviewcontroller public as part of the API (i.e. they are internal). You're welcome to copy/fork those and use them in your own project with proper namespacing.

    That being said if you want to use the listviewcontroller it probably would make sense to use the one in EditorXR. You might also want to use something simpler, too, if it is only strings you want to show.
     
  3. bss_shashankk

    bss_shashankk

    Joined:
    May 8, 2018
    Posts:
    4
    Thank you for your input @amirebrahimi_unity! I'll try to clone EditorXR project and work with it.

    Thank you so much!