Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

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,875
  3. Kiupe

    Kiupe

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

    jGate99

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

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,875
    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,842
    Is there any function that returns me all the prefabs
     
  7. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,186
    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.