public void _1_7_RunBundlizer () { GraphStackController.CleanCache(); EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.iOS); var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png"; var source = new Dictionary<string, List<InternalAssetData>> { {"0", new List<InternalAssetData> { InternalAssetData.InternalAssetDataByImporter( "traceId_1_7_RunBundlizer", 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 bundleNameTemplate = "a_*.bundle"; var integratedGUIBundlizer = new IntegratedGUIBundlizer(bundleNameTemplate); 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"]; }; integratedGUIBundlizer.Run("ID_1_7_RunBundlizer", "CONNECTION_1_7_RunBundlizer", string.Empty, source, new List<string>(), Out); var currentOutputs = results["CONNECTION_1_7_RunBundlizer"]; if (currentOutputs.Count == 1) { // should be a_0.bundle if (currentOutputs[0].pathUnderConnectionId != "iOS/a_0.bundle.ios") { Debug.LogError("failed to bundlize, name not match:" + currentOutputs[0].pathUnderConnectionId); return; } // passed, erase bundle name setting. var bundledAssetSourcePath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png"; if (!File.Exists(bundledAssetSourcePath)) { Debug.LogError("failed to delete bundle setting. bundledAssetSourcePath:" + bundledAssetSourcePath); return; } var assetImporter = AssetImporter.GetAtPath(bundledAssetSourcePath); assetImporter.assetBundleName = string.Empty; return; } Debug.LogError("failed to bundlize"); }
// there is no GUI Prefabricator. public void _1_6_SetupBundlizer () { GraphStackController.CleanCache(); var importedPath = "Assets/AssetGraphTest/PrefabricatorTestResource/SpanPath/a.png"; var source = new Dictionary<string, List<InternalAssetData>> { {"0", new List<InternalAssetData> { InternalAssetData.InternalAssetDataByImporter( "traceId_1_6_SetupBundlizer", 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 bundleNameTemplate = "a_*.bundle"; var integratedGUIBundlizer = new IntegratedGUIBundlizer(bundleNameTemplate); 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"]; }; integratedGUIBundlizer.Setup("ID_1_6_SetupBundlizer", "CONNECTION_1_6_SetupBundlizer", string.Empty, source, new List<string>(), Out); Debug.Log("passed _1_6_SetupBundlizer"); }