public override IEnumerable <ObjectNode> Init(object target) { var targetObj = target as Object; var targets = new[] { targetObj }.ToHashSet(); //var sceneGraphs = sceneFilePaths.Select( path => ObjectDependencyUtil.GetReferenceGraph( path, targets ) ); var sceneGraphs = new[] { ObjectDependencyUtil.GetActiveSceneReferenceGraph(targets) }; // when all sceneGraphs are empty, add a dummy node to represent the target if (sceneGraphs.All(x => !x.Keys.Any())) { string targetNodeName = targetObj.name + "\n(unreferenced)"; var dummyNode = new ObjectNode(targetNodeName, targetNodeName, new[] { targetObj }, false); var dummyGraph = new ObjNodeGraph(); dummyGraph[dummyNode] = new HashSet <ObjectNode>(); sceneGraphs = new[] { dummyGraph }; } foreach (var g in sceneGraphs) { ObjectDependencyUtil.AddGraph(referenceGraph, g); } System.GC.Collect(); return(ObjectGraphUtil.GetRoots(referenceGraph)); }
public override void Awake(GetAPI getAPI) { referenceGraph = new ObjNodeGraph(); base.Awake(getAPI); }