Ejemplo n.º 1
0
    public void TestReplaceWithIncomingGameObject()
    {
        var graph = LoadGraphForTest();

        var builderNode = graph.Nodes.First(n => n.Operation.ClassName == typeof(PrefabBuilder).AssemblyQualifiedName).Operation.Object as PrefabBuilder;
        var builder     = builderNode.GetPrefabBuilder(EditorUserBuildSettings.activeBuildTarget) as ReplaceWithIncomingGameObject;

        var replacing = GameObject.CreatePrimitive(PrimitiveType.Capsule);

        replacing.name = "rep";

        builder.ReplacingObject = replacing;

        using (new DisableAssetProcessEventRecordScope())
        {
            var result = AssetGraphUtility.ExecuteGraph(EditorUserBuildSettings.activeBuildTarget, graph);
            Assert.False(result.IsAnyIssueFound);
        }

        AssetDatabase.Refresh();

        var testObject = AssetDatabase.LoadAssetAtPath <GameObject>(Path.Combine(RootFolder, "replaceWith.prefab"));
        var refObject  = AssetDatabase.LoadAssetAtPath <GameObject>(Path.Combine(RootFolder, "Reference/replaceWith.prefab"));

        AssertGameObjectEqual(testObject, refObject);
    }
Ejemplo n.º 2
0
        public static void ExecuteSingle()
        {
            var graphName = $"AssetGraph - 1.asset";
            var graphPath = Path.Combine("Assets", "_", "Graphs", graphName);

            AssetGraphUtility.ExecuteGraph(graphPath);
        }
        /// <summary>
        /// build
        /// </summary>
        /// <param name="buildTarget"></param>
        /// <param name="outPath"></param>
        /// <param name="isUseHash"></param>
        static public void Build(BuildTarget buildTarget, string outPath)
        {
            var(cg, bdenvNode) = GetBDFrameExAssetGraph();
            var bdenv = (bdenvNode.Operation.Object as BDFrameworkAssetsEnv);

            bdenv.SetBuildParams(outPath, true);
            //执行
            AssetGraphUtility.ExecuteGraph(buildTarget, cg);
        }
    protected ExecuteGraphResult AssertGraphExecuteWithIssue()
    {
        ExecuteGraphResult result;

        using (new DisableAssetProcessEventRecordScope())
        {
            result = AssetGraphUtility.ExecuteGraph(EditorUserBuildSettings.activeBuildTarget, LoadGraphForTest(2));
            Assert.True(result.IsAnyIssueFound);
        }
        return(result);
    }
Ejemplo n.º 5
0
    public void TestDirectoryNotExist()
    {
        ExecuteGraphResult result;

        using (new DisableAssetProcessEventRecordScope())
        {
            result = AssetGraphUtility.ExecuteGraph(UnityEditor.EditorUserBuildSettings.activeBuildTarget, LoadGraphForTest(1, false));
        }

        Assert.True(result.IsAnyIssueFound);

        foreach (var e in result.Issues)
        {
            Assert.AreEqual(e.Node.Operation.ClassName, typeof(Loader).AssemblyQualifiedName);
        }
    }
    protected void AssertGraphExecuteWithNoIssue()
    {
        var result = AssetGraphUtility.ExecuteGraph(EditorUserBuildSettings.activeBuildTarget, LoadGraphForTest(2));

        Assert.False(result.IsAnyIssueFound);
    }
Ejemplo n.º 7
0
 static void Build()
 {
     AssetGraphUtility.ExecuteGraph("Assets/Workflow/AB.asset");
 }
Ejemplo n.º 8
0
 static public void ExecuteGraph()
 {
     AssetGraphUtility.ExecuteGraph("Assets/AssetGraph/Graph/Stage.asset");
 }