Search Unity

Indent / Foldout for sub-sub-assets in Project View?

Discussion in 'Editor & General Support' started by flip_the_unflappable, Sep 30, 2020.

  1. flip_the_unflappable

    flip_the_unflappable

    Joined:
    Jul 9, 2020
    Posts:
    11
    If I create an asset and add a subasset to it using AssetDatabase:

    Code (CSharp):
    1. // within the MainAsset context
    2. AssetDatabase.AddObjectToAsset(mySubAsset)
    Then the MainAsset will then have a foldout and I can see mySubAsset within the Project View.

    Now if I add another object to mySubAsset

    Code (CSharp):
    1. // within the mySubAsset context
    2. AssetDatabase.AddObjectToAsset(mySubSubAsset)
    Then I will see both mySubAsset and mySubSubAsset within the MainAsset foldout within the Project View. They are essentially displayed like they are siblings in this structure.

    Is there a way to further indent these? Or to have foldouts for sub-assets so that we can nest assets in a tree like structure? I would like to be able to have the parent/child relationship of multiple sub-assets within one asset file. Is a view like this possible in the Project View?

    I know that I could use TreeView and make a custom editor window, just wondering if there is a workaround

    Thanks