示例#1
0
    public void _0_4_SetupPrefabricator()
    {
        GraphStackController.CleanCache();

        var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png";

        var source = new Dictionary <string, List <InternalAssetData> > {
            { "0",
              new List <InternalAssetData> {
                  InternalAssetData.InternalAssetDataByImporter(
                      "traceId_0_4_SetupPrefabricator",
                      Path.Combine(Application.dataPath, importedPath),
                      Application.dataPath,
                      Path.GetFileName(importedPath),
                      string.Empty,
                      importedPath,
                      AssetDatabase.AssetPathToGUID(importedPath),
                      AssetGraphInternalFunctions.GetAssetType(importedPath)
                      )
              } }
        };

        var results = new Dictionary <string, List <InternalAssetData> >();

        var sPrefabricator = new SamplePrefabricator_0();
        Action <string, string, Dictionary <string, List <InternalAssetData> >, List <string> > Out = (string nodeId, string connectionId, Dictionary <string, List <InternalAssetData> > output, List <string> cached) => {
            results[connectionId] = output["0"];
        };

        sPrefabricator.Setup("ID_0_4_SetupPrefabricator", "CONNECTION_0_4_SetupPrefabricator", string.Empty, source, new List <string>(), Out);
        Debug.Log("passed _0_4_SetupPrefabricator");
    }
示例#2
0
    public void _0_5_RunPrefabricator()
    {
        GraphStackController.CleanCache();

        var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png";

        var source = new Dictionary <string, List <InternalAssetData> > {
            { "0",
              new List <InternalAssetData> {
                  InternalAssetData.InternalAssetDataByImporter(
                      "traceId_0_5_RunPrefabricator",
                      Path.Combine(Application.dataPath, importedPath),
                      Application.dataPath,
                      Path.GetFileName(importedPath),
                      string.Empty,
                      importedPath,
                      AssetDatabase.AssetPathToGUID(importedPath),
                      AssetGraphInternalFunctions.GetAssetType(importedPath)
                      )
              } }
        };

        var results = new Dictionary <string, List <InternalAssetData> >();

        var sPrefabricator = new SamplePrefabricator_0();
        Action <string, string, Dictionary <string, List <InternalAssetData> >, List <string> > Out = (string nodeId, string connectionId, Dictionary <string, List <InternalAssetData> > output, List <string> cached) => {
            results[connectionId] = output["0"];
        };

        sPrefabricator.Run("ID_0_5_RunPrefabricator", "CONNECTION_0_5_RunPrefabricator", string.Empty, source, new List <string>(), Out);

        var currentOutputs = results["CONNECTION_0_5_RunPrefabricator"].Where(assetData => !GraphStackController.IsMetaFile(assetData.importedPath)).ToList();

        if (currentOutputs.Count == 3)
        {
            // material.mat
            // prefab.prefab
            // a.png

            if (!currentOutputs[0].fileNameAndExtension.Contains("material.mat"))
            {
                Debug.LogError("not contained 'material.mat'");
            }
            if (!currentOutputs[1].fileNameAndExtension.Contains("prefab.prefab"))
            {
                Debug.LogError("not contained 'prefab.prefab'");
            }
            if (!currentOutputs[2].fileNameAndExtension.Contains("a.png"))
            {
                Debug.LogError("not contained 'a.png'");
            }

            Debug.Log("passed _0_5_RunPrefabricator");
            return;
        }

        Debug.LogError("failed to prefabricate:" + currentOutputs.Count);
    }
示例#3
0
    public void _0_4_SetupPrefabricator()
    {
        var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png";

        var source = new Dictionary<string, List<InternalAssetData>> {
            {"0",
                new List<InternalAssetData> {
                    InternalAssetData.InternalAssetDataByImporter(
                        "traceId_0_4_SetupPrefabricator",
                        Path.Combine(Application.dataPath, importedPath),
                        Application.dataPath,
                        Path.GetFileName(importedPath),
                        string.Empty,
                        importedPath,
                        AssetDatabase.AssetPathToGUID(importedPath),
                        AssetGraphInternalFunctions.GetAssetType(importedPath)
                    )
                }
            }
        };

        var results = new Dictionary<string, List<InternalAssetData>>();

        var sPrefabricator = new SamplePrefabricator_0();
        Action<string, string, Dictionary<string, List<InternalAssetData>>> Out = (string nodeId, string connectionId, Dictionary<string, List<InternalAssetData>> output) => {
            results[connectionId] = output["0"];
        };

        sPrefabricator.Setup("ID_0_4_SetupPrefabricator", "CONNECTION_0_4_SetupPrefabricator", source, Out);
        Debug.Log("passed _0_4_SetupPrefabricator");
    }
示例#4
0
    public void _0_5_RunPrefabricator()
    {
        var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png";

        var source = new Dictionary<string, List<InternalAssetData>> {
            {"0",
                new List<InternalAssetData> {
                    InternalAssetData.InternalAssetDataByImporter(
                        "traceId_0_5_RunPrefabricator",
                        Path.Combine(Application.dataPath, importedPath),
                        Application.dataPath,
                        Path.GetFileName(importedPath),
                        string.Empty,
                        importedPath,
                        AssetDatabase.AssetPathToGUID(importedPath),
                        AssetGraphInternalFunctions.GetAssetType(importedPath)
                    )
                }
            }
        };

        var results = new Dictionary<string, List<InternalAssetData>>();

        var sPrefabricator = new SamplePrefabricator_0();
        Action<string, string, Dictionary<string, List<InternalAssetData>>> Out = (string nodeId, string connectionId, Dictionary<string, List<InternalAssetData>> output) => {
            results[connectionId] = output["0"];
        };

        sPrefabricator.Run("ID_0_5_RunPrefabricator", "CONNECTION_0_5_RunPrefabricator", source, Out);

        var currentOutputs = results["CONNECTION_0_5_RunPrefabricator"];
        if (currentOutputs.Count == 3) {
            // a.png
            // material.mat
            // prefab.prefab
            Debug.Log("passed _0_5_RunPrefabricator");
            return;
        }

        Debug.LogError("failed to prefabricate");
    }
示例#5
0
	public void _0_5_RunPrefabricator () {
		GraphStackController.CleanCache();
		
		var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png";

		var source = new Dictionary<string, List<InternalAssetData>> {
			{"0", 
				new List<InternalAssetData> {
					InternalAssetData.InternalAssetDataByImporter(
						"traceId_0_5_RunPrefabricator",
						Path.Combine(Application.dataPath, importedPath),
						Application.dataPath,
						Path.GetFileName(importedPath),
						string.Empty,
						importedPath,
						AssetDatabase.AssetPathToGUID(importedPath),
						AssetGraphInternalFunctions.GetAssetType(importedPath)
					)
				}
			}
		};

		var results = new Dictionary<string, List<InternalAssetData>>();

		var sPrefabricator = new SamplePrefabricator_0();
		Action<string, string, Dictionary<string, List<InternalAssetData>>, List<string>> Out = (string nodeId, string connectionId, Dictionary<string, List<InternalAssetData>> output, List<string> cached) => {
			results[connectionId] = output["0"];
		};

		sPrefabricator.Run("ID_0_5_RunPrefabricator", "CONNECTION_0_5_RunPrefabricator", string.Empty, source, new List<string>(), Out);

		var currentOutputs = results["CONNECTION_0_5_RunPrefabricator"].Where(assetData => !GraphStackController.IsMetaFile(assetData.importedPath)).ToList();

		if (currentOutputs.Count == 3) {
			// material.mat
			// prefab.prefab
			// a.png
			
			if (!currentOutputs[0].fileNameAndExtension.Contains("material.mat")) Debug.LogError("not contained 'material.mat'");
			if (!currentOutputs[1].fileNameAndExtension.Contains("prefab.prefab")) Debug.LogError("not contained 'prefab.prefab'");
			if (!currentOutputs[2].fileNameAndExtension.Contains("a.png")) Debug.LogError("not contained 'a.png'");
			
			Debug.Log("passed _0_5_RunPrefabricator");
			return;
		}

		Debug.LogError("failed to prefabricate:" + currentOutputs.Count);
	}