Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions Packages/com.vrchat.UdonSharp/Editor/UdonSharpPrefabDAG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,10 @@ public UdonSharpPrefabDAG(IEnumerable<GameObject> allPrefabRoots)

foreach (Vertex vertex in _vertices)
{
if (PrefabUtility.IsPartOfVariantPrefab(vertex.Prefab))
{
Vertex parent = _vertexLookup[PrefabUtility.GetCorrespondingObjectFromSource(vertex.Prefab)];

if (parent == vertex)
{
throw new Exception($"Parent of vertex cannot be the same as the vertex '{vertex.Prefab}'");
}

vertex.Parents.Add(parent);
parent.Children.Add(vertex);
}

// We don't have to process prefab variant and nested prefab separately
// because prefab variant is just a nested prefab at the root GameObject of prefab.
foreach (GameObject child in vertex.Prefab.GetComponentsInChildren<Transform>(true).Select(e => e.gameObject))
{
if (child == vertex.Prefab)
{
continue;
}

if (PrefabUtility.IsAnyPrefabInstanceRoot(child))
{
GameObject parentPrefab = PrefabUtility.GetCorrespondingObjectFromSource(child);
Expand Down