Search Unity

Is it possible to see a variant "inheritance graph" ?

Discussion in 'Prefabs' started by Kiupe, Dec 13, 2018.

  1. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    Is there a way to see the whole inheritance hierarchy/graph of a prefab variant ? Because we can quickly create a variant of a variant etc.. it could became hard to remember and visualize what depends on what.

    Thanks
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
  3. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Thanks !
     
  4. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,939
  5. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    You'll need to iterate all Prefabs in the Project and find the ones that have your specified Prefab as ancestor.
     
    jGate99 likes this.
  6. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,939
    Is there any function that returns me all the prefabs
     
  7. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,332
    This should get you started:

    Code (csharp):
    1. foreach (var path in AssetDatabase.FindAssets("t:Prefab", new string[0]).Select(AssetDatabase.GUIDToAssetPath)) {
    2.    Debug.Log("Found prefab at path " + path);
    3. }
     
    runevision and jGate99 like this.