示例#1
0
 private static void DoCompileReferences(uNodeRoot graph, ICollection <GameObject> referencedGraphs)
 {
     if (referencedGraphs.Count > 0)
     {
         uNodeThreadUtility.Queue(() => {
             var graphs = referencedGraphs.Where(g => g.GetComponent <uNodeComponentSystem>() is uNodeRoot root && !(root is IIndependentGraph) || g == null).ToList();
             if (graphs.FirstOrDefault() != null)
             {
                 var graphNames = string.Join("\n", graphs.Select(g => AssetDatabase.GetAssetPath(g)));
                 if (!(graph is IIndependentGraph))
                 {
                     graphs.Insert(0, graph.gameObject);
                 }
                 if (EditorUtility.DisplayDialog("Compile graph to c#", "Some graph has referenced to the renamed member and need to be compiled" +
                                                 "\nReferenced graphs:" +
                                                 "\n" + graphNames +
                                                 "\n\nDo you want to compile this graph and referenced graphs?", "Ok", "Cancel"))
                 {
                     GenerationUtility.CompileNativeGraph(graphs);
                 }
             }
         });
     }
 }