├── .gitignore ├── Assets ├── AssetBundleGraph.meta └── AssetBundleGraph │ ├── CUI.meta │ ├── CUI │ ├── commandline.sh │ └── commandline.sh.meta │ ├── Editor.meta │ ├── Editor │ ├── GUI.meta │ ├── GUI │ │ ├── AssetBundleGraphEditorWindow.cs │ │ ├── AssetBundleGraphEditorWindow.cs.meta │ │ ├── AssetBundleGraphGUISettings.cs │ │ ├── AssetBundleGraphGUISettings.cs.meta │ │ ├── ConnectionGUI.cs │ │ ├── ConnectionGUI.cs.meta │ │ ├── ConnectionGUIInspectorHelper.cs │ │ ├── ConnectionGUIInspectorHelper.cs.meta │ │ ├── ConnectionGUIUtility.cs │ │ ├── ConnectionGUIUtility.cs.meta │ │ ├── ConnectionPoint.meta │ │ ├── ConnectionPoint │ │ │ ├── ConnectionPoint.cs │ │ │ └── ConnectionPoint.cs.meta │ │ ├── Datastructure.meta │ │ ├── Datastructure │ │ │ ├── AssetBundleGraphData.cs │ │ │ └── AssetBundleGraphData.cs.meta │ │ ├── GraphicResources.meta │ │ ├── GraphicResources │ │ │ ├── AssetGraph_Arrow.png │ │ │ ├── AssetGraph_Arrow.png.meta │ │ │ ├── AssetGraph_ConnectionPoint_EnableMark.png │ │ │ ├── AssetGraph_ConnectionPoint_EnableMark.png.meta │ │ │ ├── AssetGraph_ConnectionPoint_InputMark.png │ │ │ ├── AssetGraph_ConnectionPoint_InputMark.png.meta │ │ │ ├── AssetGraph_ConnectionPoint_OutputMark.png │ │ │ ├── AssetGraph_ConnectionPoint_OutputMark.png.meta │ │ │ ├── AssetGraph_ConnectionPoint_OutputMark_Connected.png │ │ │ ├── AssetGraph_ConnectionPoint_OutputMark_Connected.png.meta │ │ │ ├── AssetGraph_InputBG.png │ │ │ ├── AssetGraph_InputBG.png.meta │ │ │ ├── AssetGraph_OutputBG.png │ │ │ ├── AssetGraph_OutputBG.png.meta │ │ │ ├── AssetGraph_Selection.png │ │ │ └── AssetGraph_Selection.png.meta │ │ ├── NodeGUI.cs │ │ ├── NodeGUI.cs.meta │ │ ├── NodeGUIEditor.cs │ │ ├── NodeGUIEditor.cs.meta │ │ ├── NodeGUIInspectorHelper.cs │ │ ├── NodeGUIInspectorHelper.cs.meta │ │ ├── NodeGUIUtility.cs │ │ ├── NodeGUIUtility.cs.meta │ │ ├── OnConnectionEvent.cs │ │ ├── OnConnectionEvent.cs.meta │ │ ├── OnNodeEvent.cs │ │ └── OnNodeEvent.cs.meta │ ├── ScriptTemplate.meta │ ├── ScriptTemplate │ │ ├── MyFinally.cs.template │ │ ├── MyFinally.cs.template.meta │ │ ├── MyModifier.cs.template │ │ ├── MyModifier.cs.template.meta │ │ ├── MyPrefabricator.cs.template │ │ └── MyPrefabricator.cs.template.meta │ ├── System.meta │ └── System │ │ ├── Core.meta │ │ ├── Core │ │ ├── AssetBundleGraphController.cs │ │ ├── AssetBundleGraphController.cs.meta │ │ ├── AssetBundleGraphInternalFunctions.cs │ │ ├── AssetBundleGraphInternalFunctions.cs.meta │ │ ├── AssetBundleGraphSettings.cs │ │ ├── AssetBundleGraphSettings.cs.meta │ │ ├── AssetGraphPlatformSettings.cs │ │ ├── AssetGraphPlatformSettings.cs.meta │ │ ├── ConnectionData.cs │ │ ├── ConnectionData.cs.meta │ │ ├── GraphDescriptionBuilder.cs │ │ ├── GraphDescriptionBuilder.cs.meta │ │ ├── NodeData.cs │ │ ├── NodeData.cs.meta │ │ ├── SystemDataUtility.cs │ │ ├── SystemDataUtility.cs.meta │ │ ├── SystemDataValidator.cs │ │ └── SystemDataValidator.cs.meta │ │ ├── Datastructure.meta │ │ ├── Datastructure │ │ ├── Asset.cs │ │ ├── Asset.cs.meta │ │ ├── AssetInfo.cs │ │ ├── AssetInfo.cs.meta │ │ ├── ThroughputAsset.cs │ │ └── ThroughputAsset.cs.meta │ │ ├── Exception.meta │ │ ├── Exception │ │ ├── AssetBundleGraphException.cs │ │ ├── AssetBundleGraphException.cs.meta │ │ ├── NodeException.cs │ │ └── NodeException.cs.meta │ │ ├── Libs.meta │ │ ├── Libs │ │ ├── MiniJSONForAssetGraph.cs │ │ ├── MiniJSONForAssetGraph.cs.meta │ │ ├── SerializablePseudoDictionary.cs │ │ └── SerializablePseudoDictionary.cs.meta │ │ ├── NodeOperation.meta │ │ ├── NodeOperation │ │ ├── BundlizerBase.cs │ │ ├── BundlizerBase.cs.meta │ │ ├── FilterBase.cs │ │ ├── FilterBase.cs.meta │ │ ├── FinallyBase.cs │ │ ├── FinallyBase.cs.meta │ │ ├── INodeOperationBase.cs │ │ ├── INodeOperationBase.cs.meta │ │ ├── Integrated.meta │ │ ├── Integrated │ │ │ ├── IntegratedGUIBundleBuilder.cs │ │ │ ├── IntegratedGUIBundleBuilder.cs.meta │ │ │ ├── IntegratedGUIBundlizer.cs │ │ │ ├── IntegratedGUIBundlizer.cs.meta │ │ │ ├── IntegratedGUIExporter.cs │ │ │ ├── IntegratedGUIExporter.cs.meta │ │ │ ├── IntegratedGUIFilter.cs │ │ │ ├── IntegratedGUIFilter.cs.meta │ │ │ ├── IntegratedGUIGrouping.cs │ │ │ ├── IntegratedGUIGrouping.cs.meta │ │ │ ├── IntegratedGUIImportSetting.cs │ │ │ ├── IntegratedGUIImportSetting.cs.meta │ │ │ ├── IntegratedGUILoader.cs │ │ │ ├── IntegratedGUILoader.cs.meta │ │ │ ├── IntegratedGUIModifier.cs │ │ │ ├── IntegratedGUIModifier.cs.meta │ │ │ ├── InternalSamplingImportEffector.cs │ │ │ ├── InternalSamplingImportEffector.cs.meta │ │ │ ├── ModifierOperators.meta │ │ │ └── ModifierOperators │ │ │ │ ├── AnimationOperator.cs │ │ │ │ ├── AnimationOperator.cs.meta │ │ │ │ ├── AnimatorOperator.cs │ │ │ │ ├── AnimatorOperator.cs.meta │ │ │ │ ├── AvatarMaskOperator.cs │ │ │ │ ├── AvatarMaskOperator.cs.meta │ │ │ │ ├── CubemapOperator.cs │ │ │ │ ├── CubemapOperator.cs.meta │ │ │ │ ├── FlareOperator.cs │ │ │ │ ├── FlareOperator.cs.meta │ │ │ │ ├── FontOperator.cs │ │ │ │ ├── FontOperator.cs.meta │ │ │ │ ├── GUISkinOperator.cs │ │ │ │ ├── GUISkinOperator.cs.meta │ │ │ │ ├── MaterialOperator.cs │ │ │ │ ├── MaterialOperator.cs.meta │ │ │ │ ├── OperatorBase.cs │ │ │ │ ├── OperatorBase.cs.meta │ │ │ │ ├── PhysicMaterialOperator.cs │ │ │ │ ├── PhysicMaterialOperator.cs.meta │ │ │ │ ├── PhysicsMaterial2DOperator.cs │ │ │ │ ├── PhysicsMaterial2DOperator.cs.meta │ │ │ │ ├── RenderTextureOperator.cs │ │ │ │ ├── RenderTextureOperator.cs.meta │ │ │ │ ├── SceneOperator.cs │ │ │ │ ├── SceneOperator.cs.meta │ │ │ │ ├── ShaderOperator.cs │ │ │ │ └── ShaderOperator.cs.meta │ │ ├── PrefabricatorBase.cs │ │ └── PrefabricatorBase.cs.meta │ │ ├── Utility.meta │ │ └── Utility │ │ ├── FileUtility.cs │ │ ├── FileUtility.cs.meta │ │ ├── TypeUtility.cs │ │ └── TypeUtility.cs.meta │ ├── Generated.meta │ └── Generated │ ├── Editor.meta │ └── Editor │ ├── MyModifier.cs │ ├── MyModifier.cs.meta │ ├── MyPrefabricator.cs │ └── MyPrefabricator.cs.meta ├── Doc ├── 1.png ├── 100.png ├── 1000.png ├── 2.png ├── 200.png ├── 3.png ├── 300.png ├── 4.png ├── 400-0.png ├── 400-1.png ├── 400-2.png ├── 5.png ├── 500.png ├── 6.png ├── 600.png ├── 700.png ├── 800.png ├── 900.png ├── Node to Node connectivity.numbers ├── QuickStart_jp.md └── images │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7_bundlebuilder.png │ ├── 7_bundlizer_0.png │ ├── 7_bundlizer_1.png │ ├── 7_bundlizer_2.png │ ├── 7_exporter.png │ ├── 7_filter.png │ ├── 7_grouping_0.png │ ├── 7_grouping_1.png │ ├── 7_grouping_2.png │ ├── 7_importer.png │ ├── 7_loader.png │ ├── 7_prefabricator.png │ ├── 8_0.gif │ ├── 8_1.png │ ├── howto_0.gif │ ├── howto_1.gif │ ├── howto_2.gif │ ├── howto_3.gif │ ├── howto_4.gif │ ├── howto_5.gif │ ├── howto_6.png │ └── howto_7.png └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | Assets/SublimeSocketAsset/* 3 | Library/* 4 | Temp/* 5 | 6 | 7 | TestExportPlace/* 8 | 9 | Assets/AssetGraph/Temp/* 10 | 11 | Assets/AssetGraph/Temp/Bundlized/ID_0_7_RunBundlizer/bundle.assetbundle 12 | 13 | Assets/AssetGraph/Temp/Prefabricated/ID_0_5_RunPrefabricator/prefab.prefab 14 | 15 | Assets/AssetBundleGraph/Cache* 16 | Assets/AssetBundleGraph/SavedSettings* 17 | Assets/AssetBundleGraph/SettingFiles* 18 | Assets/TestAssets* 19 | Assets/SampleAssets* 20 | Assets/AssetBundleSample* 21 | Assets/AssetBundleManager* 22 | AssetBundles* 23 | 24 | Assets/AssetGraph/Cache/* 25 | 26 | 27 | Assembly-CSharp-Editor.csproj 28 | 29 | Assembly-CSharp.csproj 30 | 31 | AssetGraph.sln 32 | 33 | ProjectSettings/ClusterInputManager.asset 34 | 35 | ProjectSettings/ProjectSettings.asset 36 | 37 | ProjectSettings/ProjectSettings.asset 38 | 39 | ProjectSettings/ProjectVersion.txt 40 | 41 | ProjectSettings/UnityAnalyticsManager.asset 42 | 43 | ProjectSettings/UnityConnectSettings.asset 44 | 45 | Assembly-CSharp-Editor-vs.csproj 46 | 47 | Assembly-CSharp-vs.csproj 48 | 49 | AssetGraph-csharp.sln 50 | 51 | AssetGraphExport/* 52 | 53 | Assets/AssetGraph/ImportSettings/* 54 | AssetGraphResources2/* 55 | 56 | Assets/Plugins/* 57 | 58 | Assembly-CSharp-firstpass.csproj 59 | 60 | 61 | PreloadExport/* 62 | 63 | Preloadability/* 64 | 65 | ProjectSettings/* 66 | 67 | 68 | Assets/VSCode/* 69 | 70 | .vscode/launch.json 71 | 72 | Assets/VSCode.meta 73 | 74 | ExportFolder/* 75 | 76 | Assets/TestResourceAssets/* 77 | 78 | Assets/AssetGraph/SavedSettings/ImportSettings/* 79 | 80 | Assets/AssetGraph/SavedSettings/ModifierSettings/* 81 | 82 | Assets/AssetBundleGraph/Cache/* 83 | 84 | obj/* 85 | 86 | *.sln 87 | *.vcproj 88 | *.unityproj 89 | *.userprefs 90 | 91 | Assets/EditorGUI Style Viewer* 92 | Assets/EditorGUI Style Viewer/* 93 | Assets/SampleMat.mat 94 | 95 | Assets/SampleMat.mat.meta 96 | 97 | Assets/SampleRenderTex.renderTexture 98 | 99 | Assets/SampleRenderTex.renderTexture.meta 100 | 101 | Assets/sss.renderTexture 102 | 103 | Assets/sss.renderTexture.meta 104 | 105 | Assets/TestResourceAssets.meta 106 | 107 | Assets/ModifierTestResources/* 108 | Assets/ModifierTestResources.meta 109 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 734600e2e51534c629e6b5cf6ba59825 3 | folderAsset: yes 4 | timeCreated: 1462192276 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/CUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff1c770f7739f4768891018f42c67fab 3 | folderAsset: yes 4 | timeCreated: 1471401498 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/CUI/commandline.sh: -------------------------------------------------------------------------------- 1 | /Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -quit -projectPath $(pwd)\ 2 | -executeMethod AssetBundleGraph.AssetBundleGraphEditorWindow.BuildFromCommandline -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/CUI/commandline.sh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5a120e44714943a184c764f2810f0df 3 | timeCreated: 1450593075 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11619db6af18f4b24829b39c5cebc22b 3 | folderAsset: yes 4 | timeCreated: 1450270397 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3db47e40ea910496a9b2b237ab7f6daa 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraphEditorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d674a1fd1ce6441baa00d5f54dae5441 3 | timeCreated: 1462193146 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraphGUISettings.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace AssetBundleGraph { 3 | public class AssetBundleGraphGUISettings { 4 | public const string RESOURCE_BASEPATH = "Assets/AssetBundleGraph/Editor/GUI/GraphicResources/"; 5 | 6 | public const float NODE_BASE_WIDTH = 120f; 7 | public const float NODE_BASE_HEIGHT = 40f; 8 | 9 | public const float CONNECTION_ARROW_WIDTH = 12f; 10 | public const float CONNECTION_ARROW_HEIGHT = 15f; 11 | 12 | public const float INPUT_POINT_WIDTH = 21f; 13 | public const float INPUT_POINT_HEIGHT = 29f; 14 | 15 | public const float OUTPUT_POINT_WIDTH = 10f; 16 | public const float OUTPUT_POINT_HEIGHT = 23f; 17 | 18 | public const float FILTER_OUTPUT_SPAN = 33f; 19 | 20 | public const float CONNECTION_POINT_MARK_SIZE = 19f; 21 | 22 | public const float CONNECTION_CURVE_LENGTH = 10f; 23 | 24 | public const float TOOLBAR_HEIGHT = 20f; 25 | 26 | public const string RESOURCE_ARROW = RESOURCE_BASEPATH + "AssetGraph_Arrow.png"; 27 | 28 | public const string RESOURCE_CONNECTIONPOINT_ENABLE = RESOURCE_BASEPATH + "AssetGraph_ConnectionPoint_EnableMark.png"; 29 | public const string RESOURCE_CONNECTIONPOINT_INPUT = RESOURCE_BASEPATH + "AssetGraph_ConnectionPoint_InputMark.png"; 30 | public const string RESOURCE_CONNECTIONPOINT_OUTPUT = RESOURCE_BASEPATH + "AssetGraph_ConnectionPoint_OutputMark.png"; 31 | public const string RESOURCE_CONNECTIONPOINT_OUTPUT_CONNECTED = RESOURCE_BASEPATH + "AssetGraph_ConnectionPoint_OutputMark_Connected.png"; 32 | 33 | public const string RESOURCE_INPUT_BG = RESOURCE_BASEPATH + "AssetGraph_InputBG.png"; 34 | public const string RESOURCE_OUTPUT_BG = RESOURCE_BASEPATH + "AssetGraph_OutputBG.png"; 35 | 36 | public const string RESOURCE_SELECTION = RESOURCE_BASEPATH + "AssetGraph_Selection.png"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/AssetBundleGraphGUISettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 858c797de600c4505b203efac26c3aad 3 | timeCreated: 1462193146 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUI.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Linq; 6 | using System.Collections.Generic; 7 | 8 | namespace AssetBundleGraph { 9 | [Serializable] 10 | public class ConnectionGUI { 11 | [SerializeField] public string label; 12 | [SerializeField] public string connectionId; 13 | 14 | [SerializeField] public string outputNodeId; 15 | [SerializeField] public ConnectionPoint outputPoint; 16 | 17 | [SerializeField] public string inputNodeId; 18 | [SerializeField] public ConnectionPoint inputPoint; 19 | 20 | [SerializeField] public ConnectionGUIInspectorHelper conInsp; 21 | 22 | [SerializeField] private string connectionButtonStyle; 23 | 24 | private Rect buttonRect; 25 | 26 | public static ConnectionGUI LoadConnection (string label, string connectionId, string startNodeId, ConnectionPoint output, string endNodeId, ConnectionPoint input) { 27 | return new ConnectionGUI( 28 | label, 29 | connectionId, 30 | startNodeId, 31 | output, 32 | endNodeId, 33 | input 34 | ); 35 | } 36 | 37 | public static ConnectionGUI NewConnection (string label, string startNodeId, ConnectionPoint output, string endNodeId, ConnectionPoint input) { 38 | return new ConnectionGUI( 39 | label, 40 | Guid.NewGuid().ToString(), 41 | startNodeId, 42 | output, 43 | endNodeId, 44 | input 45 | ); 46 | } 47 | 48 | private ConnectionGUI (string label, string connectionId, string startNodeId, ConnectionPoint output, string endNodeId, ConnectionPoint input) { 49 | conInsp = ScriptableObject.CreateInstance(); 50 | conInsp.hideFlags = HideFlags.DontSave; 51 | 52 | this.label = label; 53 | this.connectionId = connectionId; 54 | 55 | this.outputNodeId = startNodeId; 56 | this.outputPoint = output; 57 | this.inputNodeId = endNodeId; 58 | this.inputPoint = input; 59 | 60 | connectionButtonStyle = "sv_label_0"; 61 | } 62 | 63 | /** 64 | Inspector GUI for this connection. 65 | */ 66 | [CustomEditor(typeof(ConnectionGUIInspectorHelper))] 67 | public class ConnectionObj : Editor { 68 | 69 | public override bool RequiresConstantRepaint() { 70 | return true; 71 | } 72 | 73 | public override void OnInspectorGUI () { 74 | var con = ((ConnectionGUIInspectorHelper)target).con; 75 | if (con == null) return; 76 | 77 | 78 | var foldouts = ((ConnectionGUIInspectorHelper)target).foldouts; 79 | 80 | 81 | var count = 0; 82 | var throughputListDict = ((ConnectionGUIInspectorHelper)target).throughputListDict; 83 | if (throughputListDict == null) return; 84 | 85 | foreach (var throughputList in throughputListDict.Values) { 86 | count += throughputList.Count; 87 | } 88 | 89 | EditorGUILayout.LabelField("Total", count.ToString()); 90 | 91 | var redColor = new GUIStyle(EditorStyles.label); 92 | redColor.normal.textColor = Color.gray; 93 | 94 | var index = 0; 95 | foreach (var groupKey in throughputListDict.Keys) { 96 | var throughputList = throughputListDict[groupKey]; 97 | 98 | var foldout = foldouts[index]; 99 | 100 | foldout = EditorGUILayout.Foldout(foldout, "Group Key:" + groupKey); 101 | if (foldout) { 102 | EditorGUI.indentLevel = 1; 103 | for (var i = 0; i < throughputList.Count; i++) { 104 | var sourceStr = throughputList[i].path; 105 | var isBundled = throughputList[i].isBundled; 106 | 107 | if (isBundled) EditorGUILayout.LabelField(sourceStr, redColor); 108 | else EditorGUILayout.LabelField(sourceStr); 109 | } 110 | EditorGUI.indentLevel = 0; 111 | } 112 | foldouts[index] = foldout; 113 | 114 | index++; 115 | } 116 | } 117 | } 118 | 119 | public Rect GetRect () { 120 | return buttonRect; 121 | } 122 | 123 | /** 124 | throughputListDict contains: 125 | group/ 126 | throughput assets 127 | */ 128 | public void DrawConnection (List nodes, Dictionary> throughputListDict) { 129 | var startNodes = nodes.Where(node => node.nodeId == outputNodeId).ToList(); 130 | if (!startNodes.Any()) return; 131 | 132 | var startPoint = startNodes[0].GlobalConnectionPointPosition(outputPoint.pointId); 133 | startPoint = NodeGUI.ScaleEffect(startPoint); 134 | var startV3 = new Vector3(startPoint.x, startPoint.y, 0f); 135 | 136 | var endNodes = nodes.Where(node => node.nodeId == inputNodeId).ToList(); 137 | if (!endNodes.Any()) return; 138 | 139 | var endPoint = endNodes[0].GlobalConnectionPointPosition(inputPoint.pointId); 140 | endPoint = NodeGUI.ScaleEffect(endPoint); 141 | var endV3 = new Vector3(endPoint.x, endPoint.y + 1f, 0f); 142 | 143 | var centerPoint = startPoint + ((endPoint - startPoint) / 2); 144 | var centerPointV3 = new Vector3(centerPoint.x, centerPoint.y, 0f); 145 | 146 | var pointDistance = (endPoint.x - startPoint.x) / 3f; 147 | if (pointDistance < AssetBundleGraphGUISettings.CONNECTION_CURVE_LENGTH) pointDistance = AssetBundleGraphGUISettings.CONNECTION_CURVE_LENGTH; 148 | 149 | var startTan = new Vector3(startPoint.x + pointDistance, startPoint.y, 0f); 150 | var endTan = new Vector3(endPoint.x - pointDistance, endPoint.y, 0f); 151 | 152 | Handles.DrawBezier(startV3, endV3, startTan, endTan, Color.gray, null, 4f); 153 | 154 | // draw connection label if connection's label is not normal. 155 | if (NodeGUI.scaleFactor == NodeGUI.SCALE_MAX) { 156 | switch (label){ 157 | case AssetBundleGraphSettings.DEFAULT_OUTPUTPOINT_LABEL: { 158 | // show nothing 159 | break; 160 | } 161 | 162 | case AssetBundleGraphSettings.BUNDLIZER_BUNDLE_OUTPUTPOINT_LABEL: { 163 | var labelPointV3 = new Vector3(centerPointV3.x - ((AssetBundleGraphSettings.BUNDLIZER_BUNDLE_OUTPUTPOINT_LABEL.Length * 6f) / 2), centerPointV3.y - 24f, 0f) ; 164 | Handles.Label(labelPointV3, AssetBundleGraphSettings.BUNDLIZER_BUNDLE_OUTPUTPOINT_LABEL); 165 | break; 166 | } 167 | 168 | default: { 169 | var labelPointV3 = new Vector3(centerPointV3.x - ((label.Length * 7f) / 2), centerPointV3.y - 24f, 0f) ; 170 | Handles.Label(labelPointV3, label); 171 | break; 172 | } 173 | } 174 | } 175 | 176 | // draw connection arrow. 177 | if (NodeGUI.scaleFactor == NodeGUI.SCALE_MAX) { 178 | GUI.DrawTexture( 179 | new Rect( 180 | endV3.x - AssetBundleGraphGUISettings.CONNECTION_ARROW_WIDTH + 4f, 181 | endV3.y - (AssetBundleGraphGUISettings.CONNECTION_ARROW_HEIGHT / 2f) - 1f, 182 | AssetBundleGraphGUISettings.CONNECTION_ARROW_WIDTH, 183 | AssetBundleGraphGUISettings.CONNECTION_ARROW_HEIGHT 184 | ), 185 | ConnectionGUIUtility.connectionArrowTex 186 | ); 187 | } 188 | 189 | /* 190 | draw throughtput badge. 191 | */ 192 | var throughputCount = 0; 193 | foreach (var list in throughputListDict.Values) { 194 | throughputCount += list.Count; 195 | } 196 | 197 | var offsetSize = throughputCount.ToString().Length * 20f; 198 | 199 | buttonRect = new Rect(centerPointV3.x - offsetSize/2f, centerPointV3.y - 7f, offsetSize, 20f); 200 | 201 | if ( 202 | Event.current.type == EventType.ContextClick 203 | || (Event.current.type == EventType.MouseUp && Event.current.button == 1) 204 | ) { 205 | var rightClickPos = Event.current.mousePosition; 206 | if (buttonRect.Contains(rightClickPos)) { 207 | var menu = new GenericMenu(); 208 | menu.AddItem( 209 | new GUIContent("Delete"), 210 | false, 211 | () => { 212 | Delete(); 213 | } 214 | ); 215 | menu.ShowAsContext(); 216 | Event.current.Use(); 217 | } 218 | } 219 | 220 | if (GUI.Button(buttonRect, throughputCount.ToString(), connectionButtonStyle)) { 221 | conInsp.UpdateCon(this, throughputListDict); 222 | ConnectionGUIUtility.FireNodeEvent(new OnConnectionEvent(OnConnectionEvent.EventType.EVENT_CONNECTION_TAPPED, this)); 223 | } 224 | } 225 | 226 | public bool IsStartAtConnectionPoint (ConnectionPoint p) { 227 | return outputPoint == p; 228 | } 229 | 230 | public bool IsEndAtConnectionPoint (ConnectionPoint p) { 231 | return inputPoint == p; 232 | } 233 | 234 | public bool IsSameDetail (NodeGUI start, ConnectionPoint output, NodeGUI end, ConnectionPoint input) { 235 | if ( 236 | outputNodeId == start.nodeId && 237 | outputPoint == output && 238 | inputNodeId == end.nodeId && 239 | inputPoint == input 240 | ) { 241 | return true; 242 | } 243 | return false; 244 | } 245 | 246 | public void SetActive () { 247 | Selection.activeObject = conInsp; 248 | connectionButtonStyle = "sv_label_1"; 249 | } 250 | 251 | public void SetInactive () { 252 | connectionButtonStyle = "sv_label_0"; 253 | } 254 | 255 | public void Delete () { 256 | ConnectionGUIUtility.FireNodeEvent(new OnConnectionEvent(OnConnectionEvent.EventType.EVENT_CONNECTION_DELETED, this)); 257 | } 258 | } 259 | 260 | public static class NodeEditor_ConnectionListExtension { 261 | public static bool ContainsConnection(this List connections, NodeGUI start, ConnectionPoint output, NodeGUI end, ConnectionPoint input) { 262 | foreach (var con in connections) { 263 | if (con.IsSameDetail(start, output, end, input)) return true; 264 | } 265 | return false; 266 | } 267 | } 268 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e929649941f874083b2193b47d7cc2ae 3 | timeCreated: 1450270421 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUIInspectorHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | /* 6 | * ScriptableObject helper object to let ConnectionGUI edit from Inspector 7 | */ 8 | public class ConnectionGUIInspectorHelper : ScriptableObject { 9 | public ConnectionGUI con; 10 | public Dictionary> throughputListDict; 11 | public List foldouts; 12 | 13 | public void UpdateCon (ConnectionGUI con, Dictionary> throughputListDict) { 14 | this.con = con; 15 | this.throughputListDict = throughputListDict; 16 | 17 | this.foldouts = new List(); 18 | for (var i = 0; i < this.throughputListDict.Count; i++) { 19 | foldouts.Add(true); 20 | } 21 | } 22 | 23 | public void UpdateThroughputs(Dictionary> throughputListDict) { 24 | this.throughputListDict = throughputListDict; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUIInspectorHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80ea3ce9379924ab3b34024afbf69a78 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUIUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Collections.Generic; 8 | 9 | 10 | namespace AssetBundleGraph { 11 | public class ConnectionGUIUtility { 12 | 13 | public static Action FireNodeEvent { 14 | get { 15 | return ConnectionGUISingleton.s.emitAction; 16 | } 17 | set { 18 | ConnectionGUISingleton.s.emitAction = value; 19 | } 20 | } 21 | 22 | public static Texture2D connectionArrowTex { 23 | get { 24 | // load shared connection textures 25 | if( ConnectionGUISingleton.s.connectionArrowTex == null ) { 26 | ConnectionGUISingleton.s.connectionArrowTex = AssetBundleGraphEditorWindow.LoadTextureFromFile(AssetBundleGraphGUISettings.RESOURCE_ARROW); 27 | } 28 | return ConnectionGUISingleton.s.connectionArrowTex; 29 | } 30 | } 31 | 32 | private class ConnectionGUISingleton { 33 | public Action emitAction; 34 | 35 | public Texture2D connectionArrowTex; 36 | 37 | private static ConnectionGUISingleton s_singleton; 38 | 39 | public static ConnectionGUISingleton s { 40 | get { 41 | if( s_singleton == null ) { 42 | s_singleton = new ConnectionGUISingleton(); 43 | } 44 | 45 | return s_singleton; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionGUIUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a77e51a511f4d44c09d32778a4b8baf7 3 | timeCreated: 1471743279 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionPoint.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8f1521b925ed46d7906e192712b129a 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionPoint/ConnectionPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using UnityEngine; 4 | 5 | namespace AssetBundleGraph { 6 | [Serializable] public class ConnectionPoint { 7 | [SerializeField] public string pointId; 8 | [SerializeField] public string label; 9 | [SerializeField] public bool isInput; 10 | [SerializeField] public bool isOutput; 11 | 12 | [SerializeField] public Rect buttonRect; 13 | [SerializeField] public string buttonStyle; 14 | 15 | public ConnectionPoint (string pointId, string label, bool input, bool output) { 16 | this.pointId = pointId; 17 | this.label = label; 18 | this.isInput = input; 19 | this.isOutput = output; 20 | } 21 | 22 | public void UpdatePos (int index, int max, float width, float height) { 23 | if (isInput) { 24 | var y = ((height/(max + 1)) * (index + 1)) - AssetBundleGraphGUISettings.INPUT_POINT_HEIGHT/2f; 25 | buttonRect = new Rect(0,y, AssetBundleGraphGUISettings.INPUT_POINT_WIDTH, AssetBundleGraphGUISettings.INPUT_POINT_HEIGHT); 26 | } 27 | 28 | if (isOutput) { 29 | var y = ((height/(max + 1)) * (index + 1)) - AssetBundleGraphGUISettings.OUTPUT_POINT_HEIGHT/2f; 30 | buttonRect = new Rect(width - AssetBundleGraphGUISettings.OUTPUT_POINT_WIDTH + 1f, y + 1f, AssetBundleGraphGUISettings.OUTPUT_POINT_WIDTH, AssetBundleGraphGUISettings.OUTPUT_POINT_HEIGHT); 31 | } 32 | } 33 | 34 | public static ConnectionPoint InputPoint (string label) { 35 | return new ConnectionPoint(AssetBundleGraphSettings.NODE_INPUTPOINT_FIXED_LABEL, label, true, false); 36 | } 37 | 38 | public static ConnectionPoint InputPoint (string pointId, string label) { 39 | return new ConnectionPoint(pointId, label, true, false); 40 | } 41 | 42 | public static ConnectionPoint OutputPoint (string pointId, string label) { 43 | return new ConnectionPoint(pointId, label, false, true); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/ConnectionPoint/ConnectionPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2aee76dba89394416802b951e30d7ac0 3 | timeCreated: 1450270417 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/Datastructure.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfe636a3578e04b6a8b816b408a8ff24 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/Datastructure/AssetBundleGraphData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | public class AssetBundleGraphData { 6 | public string lastModified; 7 | public List nodes; 8 | public List connections; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/Datastructure/AssetBundleGraphData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa44094aa884942e5ab1083ae6b835bd 3 | timeCreated: 1462193146 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: deeaa3882759b4f2b9f1f9858e79e826 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Arrow.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Arrow.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eef13eb9e0e8d42dabb28bbeaf2fcfb0 3 | timeCreated: 1450270430 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_EnableMark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_EnableMark.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_EnableMark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d0f62849a2414e889eaf29219228189 3 | timeCreated: 1450270428 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_InputMark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_InputMark.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_InputMark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1547ffd4998640b68f0a8226b2889a9 3 | timeCreated: 1450270430 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab46c7689aafd43069ae8f89559ce437 3 | timeCreated: 1450270430 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark_Connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark_Connected.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_ConnectionPoint_OutputMark_Connected.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea38cf702aa2648609ccff82840db298 3 | timeCreated: 1450270430 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_InputBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_InputBG.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_InputBG.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1db7ee549d5147d4b42adf1b7396354 3 | timeCreated: 1450270430 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_OutputBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_OutputBG.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_OutputBG.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7576b8f317a11494eae65b2335689272 3 | timeCreated: 1450270429 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Selection.png -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/GraphicResources/AssetGraph_Selection.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54f2c356f1b0d401f81cb3b364cd7afb 3 | timeCreated: 1450270429 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/NodeGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1745294417e00472eb1bc787e7dfc7f9 3 | timeCreated: 1450270417 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/NodeGUIEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6f461cffc5d0434fbab9e09615f43a7 3 | timeCreated: 1471253487 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/NodeGUIInspectorHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | /* 6 | * ScriptableObject helper object to let NodeGUI edit from Inspector 7 | */ 8 | public class NodeGUIInspectorHelper : ScriptableObject { 9 | public NodeGUI node; 10 | public List errors = new List(); 11 | 12 | public void UpdateNode (NodeGUI node) { 13 | this.node = node; 14 | } 15 | 16 | public void UpdateErrors (List errorsSource) { 17 | this.errors = errorsSource; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/NodeGUIInspectorHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1607d025da3dc479f9ff1711f4ec2dff 3 | timeCreated: 1450270416 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/NodeGUIUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c0c79e06931942679e1743d3a581f74 3 | timeCreated: 1471742476 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/OnConnectionEvent.cs: -------------------------------------------------------------------------------- 1 | namespace AssetBundleGraph { 2 | public class OnConnectionEvent { 3 | public enum EventType : int { 4 | EVENT_NONE, 5 | 6 | EVENT_CONNECTION_TAPPED, 7 | EVENT_CONNECTION_DELETED, 8 | } 9 | 10 | public readonly EventType eventType; 11 | public readonly ConnectionGUI eventSourceCon; 12 | 13 | public OnConnectionEvent (EventType type, ConnectionGUI con) { 14 | this.eventType = type; 15 | this.eventSourceCon = con; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/OnConnectionEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c53eb7916d31440ca5a2254410be346 3 | timeCreated: 1450270417 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/OnNodeEvent.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace AssetBundleGraph { 4 | public class OnNodeEvent { 5 | public enum EventType : int { 6 | EVENT_NONE, 7 | 8 | EVENT_NODE_MOVING, 9 | 10 | EVENT_NODE_CONNECT_STARTED, 11 | EVENT_NODE_CONNECTION_OVERED, 12 | EVENT_NODE_CONNECTION_RAISED, 13 | 14 | EVENT_NODE_TOUCHED, 15 | 16 | EVENT_CONNECTIONPOINT_DELETED, 17 | EVENT_CONNECTIONPOINT_LABELCHANGED, 18 | 19 | EVENT_CLOSE_TAPPED, 20 | 21 | EVENT_BEFORESAVE, 22 | EVENT_SAVE, 23 | } 24 | 25 | public readonly EventType eventType; 26 | public readonly NodeGUI eventSourceNode; 27 | public readonly string conPointId; 28 | public readonly Vector2 globalMousePosition; 29 | 30 | public OnNodeEvent (EventType type, NodeGUI node, Vector2 localMousePos, string conPointId) { 31 | this.eventType = type; 32 | this.eventSourceNode = node; 33 | this.conPointId = conPointId; 34 | this.globalMousePosition = new Vector2(localMousePos.x + node.GetX(), localMousePos.y + node.GetY()); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/GUI/OnNodeEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 281e6ecfe35624caa94884c96264caec 3 | timeCreated: 1450270417 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39ce5485524aa436484351a88c169b16 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyFinally.cs.template: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Collections.Generic; 7 | 8 | /** 9 | Example code for asset bundle build postprocess. 10 | */ 11 | public class MyFinally : AssetBundleGraph.FinallyBase { 12 | /* 13 | * Run() is called when build or dry-run is performed. 14 | * 15 | * @param [in] throughputs Dictionary of group of files targeted to build 16 | * @param [in] isBuild True if this is actual build. 17 | */ 18 | public override void Run (Dictionary>> throughputs, bool isBuild) { 19 | Debug.Log("flnally. isBuild:" + isBuild); 20 | 21 | if (!isBuild) return; 22 | 23 | foreach (var nodeName in throughputs.Keys) { 24 | Debug.Log("nodeName:" + nodeName); 25 | 26 | foreach (var groupKey in throughputs[nodeName].Keys) { 27 | Debug.Log(" groupKey:" + groupKey); 28 | 29 | foreach (var result in throughputs[nodeName][groupKey]) { 30 | Debug.Log(" result:" + result); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyFinally.cs.template.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb7f6f9ad8ac34295b21462bc9a33b17 3 | timeCreated: 1450270398 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyModifier.cs.template: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | /* 8 | public class MyModifier : AssetBundleGraph.PrefabricatorBase { 9 | public override void ValidateCanCreatePrefab (string nodeName, string nodeId, string groupKey, List sources, string recommendedPrefabOutputDir, Func Prefabricate) { 10 | // Test and see if Prefab can be created 11 | // use Prefabricate deledate to create prefab. 12 | } 13 | 14 | public override void CreatePrefab (string nodeName, string nodeId, string groupKey, List source, string recommendedPrefabOutputDir, Func Prefabricate) { 15 | // use Prefabricate deledate to create prefab. 16 | } 17 | } 18 | */ 19 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyModifier.cs.template.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a46c421ba7816473491fc9c6400d8e79 3 | timeCreated: 1472576412 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyPrefabricator.cs.template: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public class MyPrefabricator : AssetBundleGraph.PrefabricatorBase { 8 | public override void ValidateCanCreatePrefab (string nodeName, string nodeId, string groupKey, List sources, string recommendedPrefabOutputDir, Func Prefabricate) { 9 | // Test and see if Prefab can be created 10 | // use Prefabricate deledate to create prefab. 11 | } 12 | 13 | public override void CreatePrefab (string nodeName, string nodeId, string groupKey, List source, string recommendedPrefabOutputDir, Func Prefabricate) { 14 | // use Prefabricate deledate to create prefab. 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/ScriptTemplate/MyPrefabricator.cs.template.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a3aa8dcea240413d948e9004fa3e31a 3 | timeCreated: 1450270398 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf8071d9d178944c58130203347a78ec 3 | folderAsset: yes 4 | timeCreated: 1462193145 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3dc07f2f3cac414e8c9dde163d7b2db 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetBundleGraphController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 713236f51bbce4e639ea4c2f0d6e5bcd 3 | timeCreated: 1471744944 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetBundleGraphInternalFunctions.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | using System; 4 | 5 | namespace AssetBundleGraph { 6 | public class AssetBundleGraphInternalFunctions { 7 | public static Type GetTypeOfAsset (string assetPath) { 8 | if (assetPath.EndsWith(AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION)) return typeof(string); 9 | 10 | var asset = AssetDatabase.LoadMainAssetAtPath(assetPath); 11 | 12 | // If asset is null, this asset is not imported yet, or unsupported type of file 13 | // so we set this to object type. 14 | if (asset == null) { 15 | return typeof(object); 16 | } 17 | return asset.GetType(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetBundleGraphInternalFunctions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5987c0d6056d413fbc0e7b56162e845 3 | timeCreated: 1462193477 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetBundleGraphSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | public class AssetBundleGraphSettings { 6 | /* 7 | if true, ignore .meta files inside AssetBundleGraph. 8 | */ 9 | public const bool IGNORE_META = true; 10 | 11 | public const string GUI_TEXT_MENU_OPEN = "Window/AssetBundleGraph/Open Graph Editor"; 12 | public const string GUI_TEXT_MENU_BUILD = "Window/AssetBundleGraph/Build Bundles for Current Platform"; 13 | public const string GUI_TEXT_MENU_GENERATE = "Window/AssetBundleGraph/Generate Node Script"; 14 | public const string GUI_TEXT_MENU_GENERATE_MODIFIER = GUI_TEXT_MENU_GENERATE + "/Modifier Script"; 15 | public const string GUI_TEXT_MENU_GENERATE_PREFABRICATOR = GUI_TEXT_MENU_GENERATE + "/Prefabricator Script"; 16 | 17 | public const string GUI_TEXT_MENU_GENERATE_FINALLY = GUI_TEXT_MENU_GENERATE + "/Finally Script"; 18 | public const string GUI_TEXT_MENU_DELETE_CACHE = "Window/AssetBundleGraph/Clear Build Cache"; 19 | 20 | public const string GUI_TEXT_MENU_DELETE_IMPORTSETTING_SETTINGS = "Window/AssetBundleGraph/Clear Saved ImportSettings"; 21 | public const string GUI_TEXT_MENU_DELETE_MODIFIER_OPERATOR_DATAS = "Window/AssetBundleGraph/Clear Modifier Datas"; 22 | 23 | public const string ASSETNBUNDLEGRAPH_DATA_PATH = "AssetBundleGraph/SettingFiles"; 24 | public const string ASSETBUNDLEGRAPH_DATA_NAME = "AssetBundleGraph.json"; 25 | 26 | public const string ASSETS_PATH = "Assets/"; 27 | public const string ASSETBUNDLEGRAPH_PATH = ASSETS_PATH + "AssetBundleGraph/"; 28 | public const string APPLICATIONDATAPATH_CACHE_PATH = ASSETBUNDLEGRAPH_PATH + "Cache/"; 29 | public const string SCRIPT_TEMPLATE_PATH = ASSETBUNDLEGRAPH_PATH + "Editor/ScriptTemplate/"; 30 | public const string USERSPACE_PATH = ASSETBUNDLEGRAPH_PATH + "Generated/Editor/"; 31 | 32 | public const string PREFABRICATOR_CACHE_PLACE = APPLICATIONDATAPATH_CACHE_PATH + "Prefabricated"; 33 | public const string BUNDLIZER_CACHE_PLACE = APPLICATIONDATAPATH_CACHE_PATH + "Bundlized"; 34 | public const string BUNDLEBUILDER_CACHE_PLACE = APPLICATIONDATAPATH_CACHE_PATH + "BundleBuilt"; 35 | 36 | public const string IMPORTER_SETTINGS_PLACE = ASSETBUNDLEGRAPH_PATH + "SavedSettings/ImportSettings"; 37 | public const string MODIFIER_OPERATOR_DATAS_PLACE = ASSETBUNDLEGRAPH_PATH + "SavedSettings/ModifierOperatorDatas"; 38 | public const string MODIFIER_OPERATOR_DATA_NANE_PREFIX = "modifierOperatorData"; 39 | public const string MODIFIER_OPERATOR_DATA_NANE_SUFFIX = "json"; 40 | 41 | public const string UNITY_METAFILE_EXTENSION = ".meta"; 42 | public const string UNITY_LOCAL_DATAPATH = "Assets"; 43 | public const string DOTSTART_HIDDEN_FILE_HEADSTRING = "."; 44 | public const string MANIFEST_FOOTER = ".manifest"; 45 | public const string IMPORTER_RECORDFILE = ".importedRecord"; 46 | public const char UNITY_FOLDER_SEPARATOR = '/';// Mac/Windows/Linux can use '/' in Unity. 47 | 48 | public const char KEYWORD_WILDCARD = '*'; 49 | 50 | public static List DefaultBundleOptionSettings = new List { 51 | "Uncompressed AssetBundle", 52 | "Disable Write TypeTree", 53 | "Deterministic AssetBundle", 54 | "Force Rebuild AssetBundle", 55 | "Ignore TypeTree Changes", 56 | "Append Hash To AssetBundle Name", 57 | #if UNITY_5_3 58 | "ChunkBased Compression" 59 | #endif 60 | }; 61 | 62 | public const string PLATFORM_DEFAULT_NAME = "Default"; 63 | public const string PLATFORM_STANDALONE = "Standalone"; 64 | 65 | public const float WINDOW_SPAN = 20f; 66 | 67 | /* 68 | node generation from GUI 69 | */ 70 | public const string MENU_LOADER_NAME = "Loader"; 71 | public const string MENU_FILTER_NAME = "Filter"; 72 | // public const string MENU_IMPORTER_NAME = "Importer"; 73 | public const string MENU_IMPORTSETTING_NAME = "ImportSetting"; 74 | public const string MENU_MODIFIER_NAME = "Modifier"; 75 | public const string MENU_GROUPING_NAME = "Grouping"; 76 | public const string MENU_PREFABRICATOR_NAME = "Prefabricator"; 77 | public const string MENU_BUNDLIZER_NAME = "Bundlizer"; 78 | public const string MENU_BUNDLEBUILDER_NAME = "BundleBuilder"; 79 | public const string MENU_EXPORTER_NAME = "Exporter"; 80 | 81 | public static Dictionary GUI_Menu_Item_TargetGUINodeDict = new Dictionary{ 82 | {"Create " + MENU_LOADER_NAME + " Node", NodeKind.LOADER_GUI}, 83 | {"Create " + MENU_FILTER_NAME + " Node", NodeKind.FILTER_GUI}, 84 | {"Create " + MENU_IMPORTSETTING_NAME + " Node", NodeKind.IMPORTSETTING_GUI}, 85 | {"Create " + MENU_MODIFIER_NAME + " Node", NodeKind.MODIFIER_GUI}, 86 | {"Create " + MENU_GROUPING_NAME + " Node", NodeKind.GROUPING_GUI}, 87 | {"Create " + MENU_PREFABRICATOR_NAME + " Node", NodeKind.PREFABRICATOR_GUI}, 88 | {"Create " + MENU_BUNDLIZER_NAME + " Node", NodeKind.BUNDLIZER_GUI}, 89 | {"Create " + MENU_BUNDLEBUILDER_NAME + " Node", NodeKind.BUNDLEBUILDER_GUI}, 90 | {"Create " + MENU_EXPORTER_NAME + " Node", NodeKind.EXPORTER_GUI} 91 | }; 92 | 93 | public static Dictionary DEFAULT_NODE_NAME = new Dictionary{ 94 | {NodeKind.LOADER_GUI, "Loader"}, 95 | {NodeKind.FILTER_GUI, "Filter"}, 96 | {NodeKind.IMPORTSETTING_GUI, "ImportSetting"}, 97 | {NodeKind.MODIFIER_GUI, "Modifier"}, 98 | {NodeKind.GROUPING_GUI, "Grouping"}, 99 | {NodeKind.PREFABRICATOR_GUI, "Prefabricator"}, 100 | {NodeKind.BUNDLIZER_GUI, "Bundlizer"}, 101 | {NodeKind.BUNDLEBUILDER_GUI, "BundleBuilder"}, 102 | {NodeKind.EXPORTER_GUI, "Exporter"} 103 | }; 104 | 105 | /* 106 | data key for AssetBundleGraph.json 107 | */ 108 | public const string ASSETBUNDLEGRAPH_DATA_LASTMODIFIED = "lastModified"; 109 | public const string ASSETBUNDLEGRAPH_DATA_NODES = "nodes"; 110 | public const string ASSETBUNDLEGRAPH_DATA_CONNECTIONS = "connections"; 111 | 112 | // node const. 113 | public const string NODE_NAME = "name"; 114 | public const string NODE_ID = "id"; 115 | public const string NODE_KIND = "kind"; 116 | public const string NODE_SCRIPT_CLASSNAME = "scriptClassName"; 117 | public const string NODE_SCRIPT_PATH = "scriptPath"; 118 | public const string NODE_POS = "pos"; 119 | public const string NODE_POS_X = "x"; 120 | public const string NODE_POS_Y = "y"; 121 | public const string NODE_OUTPUTPOINT_LABELS = "outputPointLabels"; 122 | public const string NODE_OUTPUTPOINT_IDS = "outputPointIds"; 123 | 124 | // node dependent settings. 125 | public const string NODE_LOADER_LOAD_PATH = "loadPath"; 126 | public const string NODE_EXPORTER_EXPORT_PATH = "exportTo"; 127 | public const string NODE_FILTER_CONTAINS_KEYWORDS = "filterContainsKeywords"; 128 | public const string NODE_FILTER_CONTAINS_KEYTYPES = "filterContainsKeytypes"; 129 | public const string NODE_IMPORTER_PACKAGES = "importerPackages"; 130 | public const string NODE_GROUPING_KEYWORD = "groupingKeyword"; 131 | public const string NODE_BUNDLIZER_BUNDLENAME_TEMPLATE = "bundleNameTemplate"; 132 | public const string NODE_BUNDLIZER_VARIANTS = "variants"; 133 | public const string NODE_BUNDLEBUILDER_ENABLEDBUNDLEOPTIONS = "enabledBundleOptions"; 134 | 135 | public const string GROUPING_KEYWORD_DEFAULT = "/Group_*/"; 136 | public const string BUNDLIZER_BUNDLENAME_TEMPLATE_DEFAULT = "bundle_*.assetbundle"; 137 | 138 | // connection const. 139 | public const string CONNECTION_LABEL = "label"; 140 | public const string CONNECTION_ID = "connectionId"; 141 | public const string CONNECTION_FROMNODE = "fromNode"; 142 | public const string CONNECTION_FROMNODE_CONPOINT_ID = "fromNodeConPointId"; 143 | public const string CONNECTION_TONODE = "toNode"; 144 | public const string CONNECTION_TONODE_CONPOINT_ID = "toNodeConPointId"; 145 | 146 | // by default, AssetBundleGraph's node has only 1 InputPoint. and 147 | // this is only one definition of it's label. 148 | public const string DEFAULT_INPUTPOINT_LABEL = "-"; 149 | public const string DEFAULT_OUTPUTPOINT_LABEL = "+"; 150 | public const string BUNDLIZER_BUNDLE_OUTPUTPOINT_LABEL = "bundles"; 151 | public const string BUNDLIZER_VARIANTNAME_DEFAULT = ""; 152 | 153 | public const string BUNDLIZER_FAKE_CONNECTION_ID = "b_______-____-____-____-____________"; 154 | 155 | public const string DEFAULT_FILTER_KEYWORD = "keyword"; 156 | public const string DEFAULT_FILTER_KEYTYPE = "Any"; 157 | 158 | public const string FILTER_KEYWORD_WILDCARD = "*"; 159 | public const string FILTER_FAKE_CONNECTION_ID = "f_______-____-____-____-____________"; 160 | 161 | 162 | public const string NODE_INPUTPOINT_FIXED_LABEL = "FIXED_INPUTPOINT_ID"; 163 | 164 | 165 | public enum NodeKind : int { 166 | FILTER_SCRIPT, 167 | PREFABRICATOR_SCRIPT, 168 | 169 | LOADER_GUI, 170 | FILTER_GUI, 171 | IMPORTSETTING_GUI, 172 | MODIFIER_GUI, 173 | 174 | GROUPING_GUI, 175 | PREFABRICATOR_GUI, 176 | BUNDLIZER_GUI, 177 | BUNDLEBUILDER_GUI, 178 | 179 | EXPORTER_GUI 180 | } 181 | 182 | public static NodeKind NodeKindFromString (string val) { 183 | return (NodeKind)Enum.Parse(typeof(NodeKind), val); 184 | } 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetBundleGraphSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ff4df1ab59754629ad8c9f4f81957a2 3 | timeCreated: 1462193475 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetGraphPlatformSettings.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | public class AssetBundleGraphPlatformSettings { 6 | public static List platforms = new List { 7 | "Web", 8 | "Standalone", 9 | "iPhone", 10 | "Android", 11 | // "BlackBerry", 12 | // "Tizen", 13 | // "XBox360", 14 | // "XboxOne", 15 | // "PS3", 16 | // "PSP2", 17 | // "PS4", 18 | // "StandaloneGLESEmu", 19 | // "Metro", 20 | // "WP8", 21 | "WebGL", 22 | // "SamsungTV" 23 | }; 24 | 25 | public static string BuildTargetToHumaneString(UnityEditor.BuildTarget t) { 26 | 27 | switch(t) { 28 | case BuildTarget.Android: 29 | return "Android"; 30 | case BuildTarget.iOS: 31 | return "iOS"; 32 | case BuildTarget.Nintendo3DS: 33 | return "Nintendo 3DS"; 34 | case BuildTarget.PS3: 35 | return "PlayStation 3"; 36 | case BuildTarget.PS4: 37 | return "PlayStation 4"; 38 | case BuildTarget.PSM: 39 | return "PlayStation Mobile"; 40 | case BuildTarget.PSP2: 41 | return "PlayStation Vita"; 42 | case BuildTarget.SamsungTV: 43 | return "Samsung TV"; 44 | case BuildTarget.StandaloneLinux: 45 | return "Linux Standalone"; 46 | case BuildTarget.StandaloneLinux64: 47 | return "Linux Standalone(64-bit)"; 48 | case BuildTarget.StandaloneLinuxUniversal: 49 | return "Linux Standalone(Universal)"; 50 | case BuildTarget.StandaloneOSXIntel: 51 | return "OSX Standalone"; 52 | case BuildTarget.StandaloneOSXIntel64: 53 | return "OSX Standalone(64-bit)"; 54 | case BuildTarget.StandaloneOSXUniversal: 55 | return "OSX Standalone(Universal)"; 56 | case BuildTarget.StandaloneWindows: 57 | return "Windows Standalone"; 58 | case BuildTarget.StandaloneWindows64: 59 | return "Windows Standalone(64-bit)"; 60 | case BuildTarget.Tizen: 61 | return "Tizen"; 62 | case BuildTarget.tvOS: 63 | return "tvOS"; 64 | case BuildTarget.WebGL: 65 | return "WebGL"; 66 | case BuildTarget.WiiU: 67 | return "Wii U"; 68 | case BuildTarget.WSAPlayer: 69 | return "Windows Store Apps"; 70 | case BuildTarget.XBOX360: 71 | return "Xbox 360"; 72 | case BuildTarget.XboxOne: 73 | return "Xbox One"; 74 | default: 75 | return t.ToString() + "(deprecated)"; 76 | } 77 | 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/AssetGraphPlatformSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cb993e63e023473a8cc3d1a945d8844 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/ConnectionData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Collections.Generic; 9 | using System.Security.Cryptography; 10 | 11 | namespace AssetBundleGraph { 12 | public class ConnectionData { 13 | public readonly string connectionId; 14 | public readonly string connectionLabel; 15 | public readonly string fromNodeId; 16 | public readonly string fromNodeOutputPointId; 17 | public readonly string toNodeId; 18 | public readonly string toNodeInputPointId; 19 | 20 | public ConnectionData (string connectionId, string connectionLabel, string fromNodeId, string fromNodeOutputPointId, string toNodeId, string toNodeInputPointId) { 21 | this.connectionId = connectionId; 22 | this.connectionLabel = connectionLabel; 23 | this.fromNodeId = fromNodeId; 24 | this.fromNodeOutputPointId = fromNodeOutputPointId; 25 | this.toNodeId = toNodeId; 26 | this.toNodeInputPointId = toNodeInputPointId; 27 | } 28 | 29 | public ConnectionData (ConnectionData connection) { 30 | this.connectionId = connection.connectionId; 31 | this.connectionLabel = connection.connectionLabel; 32 | this.fromNodeId = connection.fromNodeId; 33 | this.fromNodeOutputPointId = connection.fromNodeOutputPointId; 34 | this.toNodeId = connection.toNodeId; 35 | this.toNodeInputPointId = connection.toNodeInputPointId; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/ConnectionData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95d8a1b6bff824cfabd9d80d366021b5 3 | timeCreated: 1471740359 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/GraphDescriptionBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87375e71542cf454597d0140d2ce1515 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/NodeData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Collections.Generic; 9 | using System.Security.Cryptography; 10 | 11 | namespace AssetBundleGraph { 12 | public class NodeData { 13 | public readonly string nodeName; 14 | public readonly string nodeId; 15 | public readonly AssetBundleGraphSettings.NodeKind nodeKind; 16 | public readonly List outputPointIds; 17 | 18 | // for All script nodes & prefabricator, bundlizer GUI. 19 | public readonly string scriptClassName; 20 | 21 | // for Loader Script 22 | public readonly Dictionary loadFilePath; 23 | 24 | // for Exporter Script 25 | public readonly Dictionary exportFilePath; 26 | 27 | // for Filter GUI data 28 | public readonly List containsKeywords; 29 | public readonly List containsKeytypes; 30 | 31 | // for Importer GUI data 32 | public readonly Dictionary importerPackages; 33 | 34 | // for Modifier GUI data 35 | public readonly Dictionary modifierPackages; 36 | 37 | // for Grouping GUI data 38 | public readonly Dictionary groupingKeyword; 39 | 40 | // for Bundlizer GUI data 41 | public readonly Dictionary bundleNameTemplate; 42 | public readonly Dictionary variants; 43 | 44 | // for BundleBuilder GUI data 45 | public readonly Dictionary> enabledBundleOptions; 46 | 47 | 48 | public List connectionToParents = new List(); 49 | 50 | private bool done; 51 | 52 | public NodeData ( 53 | string nodeId, 54 | AssetBundleGraphSettings.NodeKind nodeKind, 55 | string nodeName, 56 | List outputPointIds, 57 | string scriptClassName = null, 58 | Dictionary loadPath = null, 59 | Dictionary exportTo = null, 60 | List filterContainsKeywords = null, 61 | List filterContainsKeytypes = null, 62 | Dictionary importerPackages = null, 63 | Dictionary modifierPackages = null, 64 | Dictionary groupingKeyword = null, 65 | Dictionary bundleNameTemplate = null, 66 | Dictionary variants = null, 67 | Dictionary> enabledBundleOptions = null 68 | ) { 69 | this.nodeId = nodeId; 70 | this.nodeKind = nodeKind; 71 | this.nodeName = nodeName; 72 | this.outputPointIds = outputPointIds; 73 | 74 | this.scriptClassName = null; 75 | this.loadFilePath = null; 76 | this.exportFilePath = null; 77 | this.containsKeywords = null; 78 | this.importerPackages = null; 79 | this.modifierPackages = null; 80 | this.groupingKeyword = null; 81 | this.variants = null; 82 | this.bundleNameTemplate = null; 83 | this.enabledBundleOptions = null; 84 | 85 | switch (nodeKind) { 86 | case AssetBundleGraphSettings.NodeKind.LOADER_GUI: { 87 | this.loadFilePath = loadPath; 88 | break; 89 | } 90 | case AssetBundleGraphSettings.NodeKind.EXPORTER_GUI: { 91 | this.exportFilePath = exportTo; 92 | break; 93 | } 94 | 95 | case AssetBundleGraphSettings.NodeKind.FILTER_SCRIPT: 96 | case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_SCRIPT: 97 | case AssetBundleGraphSettings.NodeKind.PREFABRICATOR_GUI: { 98 | this.scriptClassName = scriptClassName; 99 | break; 100 | } 101 | 102 | case AssetBundleGraphSettings.NodeKind.FILTER_GUI: { 103 | this.containsKeywords = filterContainsKeywords; 104 | this.containsKeytypes = filterContainsKeytypes; 105 | break; 106 | } 107 | 108 | case AssetBundleGraphSettings.NodeKind.IMPORTSETTING_GUI: { 109 | this.importerPackages = importerPackages; 110 | break; 111 | } 112 | 113 | case AssetBundleGraphSettings.NodeKind.MODIFIER_GUI: { 114 | this.modifierPackages = modifierPackages; 115 | break; 116 | } 117 | 118 | case AssetBundleGraphSettings.NodeKind.GROUPING_GUI: { 119 | this.groupingKeyword = groupingKeyword; 120 | break; 121 | } 122 | 123 | case AssetBundleGraphSettings.NodeKind.BUNDLIZER_GUI: { 124 | this.bundleNameTemplate = bundleNameTemplate; 125 | this.variants = variants; 126 | break; 127 | } 128 | 129 | case AssetBundleGraphSettings.NodeKind.BUNDLEBUILDER_GUI: { 130 | this.enabledBundleOptions = enabledBundleOptions; 131 | break; 132 | } 133 | 134 | default: { 135 | Debug.LogError(nodeName + " is defined as unknown kind of node. value:" + nodeKind); 136 | break; 137 | } 138 | } 139 | } 140 | 141 | public void AddConnectionToParent (ConnectionData connection) { 142 | connectionToParents.Add(new ConnectionData(connection)); 143 | } 144 | 145 | public void Done () { 146 | done = true; 147 | } 148 | 149 | public bool IsAlreadyDone () { 150 | return done; 151 | } 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/NodeData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cc8b6c5806d8466fa1f8208035442f6 3 | timeCreated: 1471740356 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/SystemDataUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Collections.Generic; 9 | using System.Security.Cryptography; 10 | 11 | /** 12 | static executor for AssetBundleGraph's data. 13 | */ 14 | namespace AssetBundleGraph { 15 | public class SystemDataUtility { 16 | 17 | /** 18 | Return true if given asset is already Cached 19 | */ 20 | public static bool IsCached (Asset relatedAsset, List alreadyCachedPath, string localAssetPath) { 21 | if (alreadyCachedPath.Contains(localAssetPath)) { 22 | // if source is exists, check hash. 23 | var sourceHash = GetHash(relatedAsset.absoluteAssetPath); 24 | var destHash = GetHash(localAssetPath); 25 | 26 | // completely hit. 27 | if (sourceHash.SequenceEqual(destHash)) { 28 | return true; 29 | } 30 | } 31 | 32 | return false; 33 | } 34 | 35 | /** 36 | Return true if all given assets are cached in most updated manner 37 | */ 38 | public static bool IsAllAssetsCachedAndUpdated (List relatedAssets, List alreadyCachedPath, string localAssetPath) { 39 | // check prefab-out file is exist or not. 40 | if (alreadyCachedPath.Contains(localAssetPath)) { 41 | 42 | // cached. check if 43 | var changed = false; 44 | foreach (var relatedAsset in relatedAssets) { 45 | if (relatedAsset.isNew) { 46 | changed = true; 47 | break; 48 | } 49 | } 50 | 51 | if (changed) return false; 52 | return true; 53 | } 54 | return false; 55 | } 56 | 57 | public static byte[] GetHash (string filePath) { 58 | using (var md5 = MD5.Create()) { 59 | using (var stream = File.OpenRead(filePath)) { 60 | return md5.ComputeHash(stream); 61 | } 62 | } 63 | } 64 | 65 | public static List CreateCustomFilterInstanceForScript (string scriptClassName) { 66 | var nodeScriptInstance = Assembly.LoadFile("Library/ScriptAssemblies/Assembly-CSharp-Editor.dll").CreateInstance(scriptClassName); 67 | if (nodeScriptInstance == null) { 68 | Debug.LogError("Failed to create instance for " + scriptClassName + ". No such class found in assembly."); 69 | return new List(); 70 | } 71 | 72 | var labels = new List(); 73 | Action>, List> Output = (string dataSourceNodeId, string connectionLabel, Dictionary> source, List usedCache) => { 74 | labels.Add(connectionLabel); 75 | }; 76 | 77 | ((FilterBase)nodeScriptInstance).Setup( 78 | "GetLabelsFromSetupFilter_dummy_nodeName", 79 | "GetLabelsFromSetupFilter_dummy_nodeId", 80 | string.Empty, 81 | new Dictionary>{ 82 | {"0", new List()} 83 | }, 84 | new List(), 85 | Output 86 | ); 87 | return labels; 88 | 89 | } 90 | 91 | public static T CreateNodeOperationInstance (string typeStr, string nodeId) where T : INodeOperationBase { 92 | var nodeScriptInstance = Assembly.LoadFile("Library/ScriptAssemblies/Assembly-CSharp-Editor.dll").CreateInstance(typeStr); 93 | if (nodeScriptInstance == null) { 94 | throw new NodeException("failed to generate class information of class:" + typeStr + " which is based on Type:" + typeof(T), nodeId); 95 | } 96 | return ((T)nodeScriptInstance); 97 | } 98 | 99 | public static string GetPlatformValue (Dictionary packageDict, string platform) { 100 | var key = CreateKeyNameFromString(platform); 101 | if (packageDict.ContainsKey(key)) { 102 | return packageDict[key]; 103 | } 104 | 105 | if (packageDict.ContainsKey(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME)) { 106 | return packageDict[AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME]; 107 | } 108 | 109 | throw new AssetBundleGraphException("Default setting not found."); 110 | } 111 | 112 | public static List GetPlatformValue (Dictionary> packageDict, string platform) { 113 | var key = CreateKeyNameFromString(platform); 114 | if (packageDict.ContainsKey(key)) { 115 | return packageDict[key]; 116 | } 117 | 118 | if (packageDict.ContainsKey(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME)) { 119 | return packageDict[AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME]; 120 | } 121 | 122 | throw new AssetBundleGraphException("Default setting not found."); 123 | } 124 | 125 | public static List GetCurrentPlatformValue (Dictionary> packageDict) { 126 | var platformPackageKeyCandidate = GetCurrentPlatformKey(); 127 | 128 | if (packageDict.ContainsKey(platformPackageKeyCandidate)) { 129 | return packageDict[platformPackageKeyCandidate]; 130 | } 131 | 132 | if (packageDict.ContainsKey(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME)) { 133 | return packageDict[AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME]; 134 | } 135 | 136 | throw new AssetBundleGraphException("Default setting not found."); 137 | } 138 | 139 | public static string GetCurrentPlatformValue (Dictionary packageDict) { 140 | var platformPackageKeyCandidate = GetCurrentPlatformKey(); 141 | /* 142 | check best match for platform + pacakge. 143 | */ 144 | if (packageDict.ContainsKey(platformPackageKeyCandidate)) { 145 | return packageDict[platformPackageKeyCandidate]; 146 | } 147 | 148 | /* 149 | check next match for defaultPlatform + package. 150 | */ 151 | var defaultPlatformAndCurrentPackageCandidate = GetDefaultPlatformKey(); 152 | if (packageDict.ContainsKey(defaultPlatformAndCurrentPackageCandidate)) { 153 | return packageDict[defaultPlatformAndCurrentPackageCandidate]; 154 | } 155 | 156 | /* 157 | check default platform. 158 | */ 159 | if (packageDict.ContainsKey(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME)) { 160 | return packageDict[AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME]; 161 | } 162 | 163 | throw new AssetBundleGraphException("Default setting not found."); 164 | } 165 | 166 | public static string GetCurrentPlatformShortName () { 167 | var currentPlatformCandidate = EditorUserBuildSettings.activeBuildTarget.ToString(); 168 | return currentPlatformCandidate; 169 | } 170 | 171 | public static string GetCurrentPlatformKey () { 172 | var currentPlatformCandidate = GetCurrentPlatformShortName(); 173 | 174 | return CreateKeyNameFromString(currentPlatformCandidate); 175 | } 176 | 177 | public static string GetDefaultPlatformKey () { 178 | return CreateKeyNameFromString(AssetBundleGraphSettings.PLATFORM_DEFAULT_NAME); 179 | } 180 | 181 | public static string CreateKeyNameFromString (string keyname) { 182 | return keyname.Replace(" ", "_"); 183 | } 184 | 185 | public static string GetProjectName () { 186 | var assetsPath = Application.dataPath; 187 | var projectFolderNameArray = assetsPath.Split(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR); 188 | var projectFolderName = projectFolderNameArray[projectFolderNameArray.Length - 2] + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; 189 | return projectFolderName; 190 | } 191 | 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/SystemDataUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df88cca39b5f7467b859c325ee9ede8b 3 | timeCreated: 1471740311 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Core/SystemDataValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55b66fe6361d449e2a04912371cd7bb7 3 | timeCreated: 1471740318 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fdf0adff7db54bf88c0d0661d2a3271 3 | folderAsset: yes 4 | timeCreated: 1471739875 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/Asset.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | 7 | namespace AssetBundleGraph { 8 | public class Asset { 9 | public readonly Guid guid; 10 | public readonly string assetDatabaseId; 11 | public readonly string absoluteAssetPath; 12 | // public readonly string sourceBasePath; 13 | // public readonly string pathUnderSourceBase; 14 | public readonly string importFrom; 15 | public readonly string exportTo; 16 | public readonly Type assetType; 17 | public readonly bool isNew; 18 | public readonly bool isBundled; 19 | 20 | public string id { 21 | get { 22 | return guid.ToString(); 23 | } 24 | } 25 | 26 | public string fileNameAndExtension { 27 | get { 28 | if(absoluteAssetPath != null) { 29 | return Path.GetFileName(absoluteAssetPath); 30 | } 31 | if(importFrom != null) { 32 | return Path.GetFileName(importFrom); 33 | } 34 | if(exportTo != null) { 35 | return Path.GetFileName(exportTo); 36 | } 37 | return null; 38 | } 39 | } 40 | 41 | /** 42 | Create Asset info from Loader 43 | */ 44 | public static Asset CreateNewAssetFromLoader (string absoluteAssetPath, string importFrom) { 45 | return new Asset( 46 | guid: Guid.NewGuid(), 47 | assetDatabaseId:AssetDatabase.AssetPathToGUID(importFrom), 48 | absoluteAssetPath:absoluteAssetPath, 49 | importFrom:importFrom, 50 | assetType:TypeUtility.GetTypeOfAsset(importFrom) 51 | ); 52 | } 53 | 54 | /** 55 | new assets which is generated on Imported or Prefabricated. 56 | */ 57 | public static Asset CreateNewAssetWithImportPathAndStatus (string importFrom, bool isNew, bool isBundled) { 58 | return new Asset( 59 | guid:Guid.NewGuid(), 60 | assetDatabaseId:AssetDatabase.AssetPathToGUID(importFrom), 61 | importFrom:importFrom, 62 | assetType:TypeUtility.GetTypeOfAsset(importFrom), 63 | isNew:isNew, 64 | isBundled:isBundled 65 | ); 66 | } 67 | 68 | /** 69 | * used by BundleBuilder 70 | */ 71 | public static Asset CreateAssetWithImportPath (string importFrom) { 72 | return new Asset( 73 | guid: Guid.NewGuid(), 74 | importFrom:importFrom); 75 | } 76 | 77 | /** 78 | * used by Exporter 79 | */ 80 | public static Asset CreateAssetWithExportPath (string exportTo) { 81 | return new Asset( 82 | guid: Guid.NewGuid(), 83 | exportTo:exportTo 84 | ); 85 | } 86 | 87 | /** 88 | Create Asset with new assetType configured 89 | */ 90 | public static Asset DuplicateAsset (Asset asset) { 91 | return new Asset( 92 | guid:asset.guid, 93 | assetDatabaseId:asset.assetDatabaseId, 94 | absoluteAssetPath:asset.absoluteAssetPath, 95 | importFrom:asset.importFrom, 96 | exportTo:asset.exportTo, 97 | assetType:asset.assetType, 98 | isNew:asset.isNew, 99 | isBundled:asset.isBundled 100 | ); 101 | } 102 | 103 | /** 104 | Create Asset with new assetType configured 105 | */ 106 | public static Asset DuplicateAssetWithNewType (Asset asset, Type newAssetType) { 107 | return new Asset( 108 | guid:asset.guid, 109 | assetDatabaseId:asset.assetDatabaseId, 110 | absoluteAssetPath:asset.absoluteAssetPath, 111 | importFrom:asset.importFrom, 112 | exportTo:asset.exportTo, 113 | assetType:newAssetType, 114 | isNew:asset.isNew, 115 | isBundled:asset.isBundled 116 | ); 117 | } 118 | 119 | /** 120 | Create Asset with new status (isNew, isBundled) configured 121 | */ 122 | public static Asset DuplicateAssetWithNewStatus (Asset asset, bool isNew, bool isBundled) { 123 | return new Asset( 124 | guid:asset.guid, 125 | assetDatabaseId:asset.assetDatabaseId, 126 | absoluteAssetPath:asset.absoluteAssetPath, 127 | importFrom:asset.importFrom, 128 | exportTo:asset.exportTo, 129 | assetType:asset.assetType, 130 | isNew:isNew, 131 | isBundled:isBundled 132 | ); 133 | } 134 | 135 | /** 136 | * used by Bundlizer 137 | * new assets which is generated on Bundlized. 138 | no file exists. only setting applyied. 139 | */ 140 | public static Asset DuplicateAssetWithNewImportPath (Asset asset, string importFrom) { 141 | return new Asset( 142 | guid:asset.guid, 143 | assetDatabaseId:asset.assetDatabaseId, 144 | absoluteAssetPath:asset.absoluteAssetPath, 145 | importFrom:importFrom, 146 | exportTo:asset.exportTo, 147 | assetType:asset.assetType, 148 | isNew:asset.isNew, 149 | isBundled:asset.isBundled 150 | ); 151 | } 152 | 153 | 154 | 155 | 156 | private Asset ( 157 | Guid guid, 158 | string assetDatabaseId = null, 159 | string absoluteAssetPath = null, 160 | // string sourceBasePath = null, 161 | // string fileNameAndExtension = null, 162 | // string pathUnderSourceBase = null, 163 | string importFrom = null, 164 | string exportTo = null, 165 | Type assetType = null, 166 | bool isNew = false, 167 | bool isBundled = false 168 | ) { 169 | if(assetType == typeof(object)) { 170 | throw new AssetBundleGraphException("Unknown type asset is created:" + absoluteAssetPath); 171 | } 172 | 173 | this.guid = guid; 174 | this.absoluteAssetPath = absoluteAssetPath; 175 | // this.sourceBasePath = sourceBasePath; 176 | // this.fileNameAndExtension = fileNameAndExtension; 177 | // this.pathUnderSourceBase = pathUnderSourceBase; 178 | this.importFrom = importFrom; 179 | this.exportTo = exportTo; 180 | this.assetDatabaseId = assetDatabaseId; 181 | this.assetType = assetType; 182 | this.isNew = isNew; 183 | this.isBundled = isBundled; 184 | } 185 | /* 186 | public static string GetPathWithoutBasePath (string localPathWithBasePath, string basePath) { 187 | var replaced = localPathWithBasePath.Replace(basePath, string.Empty); 188 | if (replaced.StartsWith(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR.ToString())) return replaced.Substring(1); 189 | return replaced; 190 | } 191 | */ 192 | public string GetAbsolutePathOrImportedPath () { 193 | if (absoluteAssetPath != null) { 194 | return absoluteAssetPath; 195 | } 196 | return importFrom; 197 | } 198 | } 199 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/Asset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0322717c311004dd390a287ae8e6fd54 3 | timeCreated: 1450270416 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/AssetInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AssetBundleGraph { 4 | public class DepreacatedAssetInfo { 5 | public readonly string assetName; 6 | public readonly Type assetType; 7 | public readonly string assetPath; 8 | public readonly string assetDatabaseId; 9 | 10 | public DepreacatedAssetInfo (string assetName, Type assetType, string assetPath, string assetDatabaseId) { 11 | this.assetName = assetName; 12 | this.assetType = assetType; 13 | this.assetPath = assetPath; 14 | this.assetDatabaseId = assetDatabaseId; 15 | } 16 | 17 | public override string ToString () { 18 | return "assetName:" + assetName + " assetType:" + assetType + " assetPath:" + assetPath + " assetDatabaseId:" + assetDatabaseId; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/AssetInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6454f8e08f214ae19a6d44c0217f780 3 | timeCreated: 1450270420 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/ThroughputAsset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AssetBundleGraph { 4 | public struct DepreacatedThroughputAsset { 5 | public readonly string path; 6 | public readonly bool isBundled; 7 | 8 | public DepreacatedThroughputAsset (string path, bool isBundled) { 9 | this.path = path; 10 | this.isBundled = isBundled; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Datastructure/ThroughputAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b473973c1b51345d0b3301f924614522 3 | timeCreated: 1471746374 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Exception.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56f5c97f80a3c4e038a58f5c52c41f21 3 | folderAsset: yes 4 | timeCreated: 1471740118 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Exception/AssetBundleGraphException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | 5 | namespace AssetBundleGraph { 6 | 7 | public class AssetBundleGraphException : Exception { 8 | 9 | public AssetBundleGraphException(string message) : base(message) { 10 | } 11 | } 12 | 13 | public class AssetBundleGraphSetupException : AssetBundleGraphException { 14 | 15 | public AssetBundleGraphSetupException(string message) : base(message) { 16 | } 17 | } 18 | 19 | public class AssetBundleGraphBuildException : AssetBundleGraphException { 20 | public AssetBundleGraphBuildException(string message) : base(message) { 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Exception/AssetBundleGraphException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 018ddae6b7fb74928ac0cb5c006a6511 3 | timeCreated: 1470524347 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Exception/NodeException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AssetBundleGraph { 4 | public class NodeException : Exception { 5 | public readonly string reason; 6 | public readonly string nodeId; 7 | 8 | public NodeException (string reason, string nodeId) { 9 | this.reason = reason; 10 | this.nodeId = nodeId; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Exception/NodeException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225be2e2cc2894119adb1f06234232e9 3 | timeCreated: 1460815719 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4dc703c3d172c478ba86af214865635c 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Libs/MiniJSONForAssetGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d6188766a96e4d838e29357f1ac8f05 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Libs/SerializablePseudoDictionary.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | 7 | namespace AssetBundleGraph { 8 | /* 9 | string key & string value only. 10 | because generic dictionary class cannot undo. 11 | 12 | write -> Add(k,v) -> new dict -> keys, values 13 | read <- ReadonlyDict() <- new dict <- keys, values 14 | */ 15 | [Serializable] public class SerializablePseudoDictionary { 16 | [SerializeField] private List keys = new List(); 17 | [SerializeField] private List values = new List(); 18 | 19 | 20 | public List Keys { 21 | get { 22 | return keys; 23 | } 24 | } 25 | 26 | public List Values { 27 | get { 28 | return values; 29 | } 30 | } 31 | 32 | public SerializablePseudoDictionary (Dictionary baseDict) { 33 | var dict = new Dictionary(baseDict); 34 | 35 | keys = dict.Keys.ToList(); 36 | values = dict.Values.ToList(); 37 | } 38 | 39 | public void Add (string key, string val) { 40 | var dict = new Dictionary(); 41 | 42 | for (var i = 0; i < keys.Count; i++) { 43 | var currentKey = keys[i]; 44 | var currentVal = values[i]; 45 | dict[currentKey] = currentVal; 46 | } 47 | 48 | // add or update parameter. 49 | dict[key] = val; 50 | 51 | keys = new List(dict.Keys); 52 | values = new List(dict.Values); 53 | } 54 | 55 | public bool ContainsKey (string key) { 56 | var dict = new Dictionary(); 57 | 58 | for (var i = 0; i < keys.Count; i++) { 59 | var currentKey = keys[i]; 60 | var currentVal = values[i]; 61 | dict[currentKey] = currentVal; 62 | } 63 | 64 | return dict.ContainsKey(key); 65 | } 66 | 67 | public void Remove (string key) { 68 | var dict = new Dictionary(); 69 | 70 | for (var i = 0; i < keys.Count; i++) { 71 | var currentKey = keys[i]; 72 | var currentVal = values[i]; 73 | dict[currentKey] = currentVal; 74 | } 75 | 76 | dict.Remove(key); 77 | keys = new List(dict.Keys); 78 | values = new List(dict.Values); 79 | } 80 | 81 | public Dictionary ReadonlyDict () { 82 | var dict = new Dictionary(); 83 | if (keys == null) return dict; 84 | 85 | for (var i = 0; i < keys.Count; i++) { 86 | var key = keys[i]; 87 | var val = values[i]; 88 | dict[key] = val; 89 | } 90 | 91 | return dict; 92 | } 93 | } 94 | 95 | 96 | /* 97 | string key & List value only. 98 | because generic dictionary class cannot undo. 99 | 100 | write -> Add(k,v) -> new dict -> keys, values 101 | read <- ReadonlyDict() <- new dict <- keys, values 102 | */ 103 | [Serializable] public class SerializablePseudoDictionary2 { 104 | [SerializeField] private List keys = new List(); 105 | [SerializeField] private List values = new List(); 106 | 107 | public SerializablePseudoDictionary2 (Dictionary> baseDict) { 108 | var dict = new Dictionary>(baseDict); 109 | 110 | keys = dict.Keys.ToList(); 111 | values = new List(); 112 | foreach (var val in dict.Values.ToList()) { 113 | values.Add(new SerializablePseudoDictionary2Value(val)); 114 | } 115 | } 116 | 117 | public void Add (string key, List val) { 118 | var dict = new Dictionary>(); 119 | 120 | for (var i = 0; i < keys.Count; i++) { 121 | var currentKey = keys[i]; 122 | var currentVal = values[i]; 123 | dict[currentKey] = currentVal.ReadonlyList(); 124 | } 125 | 126 | // add or update parameter. 127 | dict[key] = val; 128 | 129 | keys = dict.Keys.ToList(); 130 | values = new List(); 131 | foreach (var dictVal in dict.Values.ToList()) { 132 | values.Add(new SerializablePseudoDictionary2Value(dictVal)); 133 | } 134 | } 135 | 136 | public bool ContainsKey (string key) { 137 | var dict = new Dictionary>(); 138 | 139 | for (var i = 0; i < keys.Count; i++) { 140 | var currentKey = keys[i]; 141 | var currentVal = values[i]; 142 | dict[currentKey] = currentVal.ReadonlyList(); 143 | } 144 | 145 | return dict.ContainsKey(key); 146 | } 147 | 148 | public Dictionary> ReadonlyDict () { 149 | var dict = new Dictionary>(); 150 | if (keys == null) return dict; 151 | 152 | for (var i = 0; i < keys.Count; i++) { 153 | var key = keys[i]; 154 | var val = values[i].ReadonlyList(); 155 | dict[key] = val; 156 | } 157 | 158 | return dict; 159 | } 160 | 161 | public void Remove (string key) { 162 | var dict = new Dictionary>(); 163 | 164 | for (var i = 0; i < keys.Count; i++) { 165 | var currentKey = keys[i]; 166 | var currentVal = values[i].ReadonlyList(); 167 | dict[currentKey] = currentVal; 168 | } 169 | 170 | dict.Remove(key); 171 | keys = dict.Keys.ToList(); 172 | values = new List(); 173 | foreach (var dictVal in dict.Values.ToList()) { 174 | values.Add(new SerializablePseudoDictionary2Value(dictVal)); 175 | } 176 | } 177 | 178 | [Serializable] public class SerializablePseudoDictionary2Value { 179 | [SerializeField] private List values = new List(); 180 | 181 | public SerializablePseudoDictionary2Value (List sources) { 182 | foreach (var source in sources) values.Add(source); 183 | } 184 | 185 | public List ReadonlyList () { 186 | return values; 187 | } 188 | 189 | } 190 | } 191 | 192 | 193 | /* 194 | string key & Vector2 value only. 195 | because generic dictionary class cannot undo. 196 | 197 | write -> Add(k,v) -> new dict -> keys, values 198 | read <- ReadonlyDict() <- new dict <- keys, values 199 | */ 200 | [Serializable] public class SerializablePseudoDictionary3 { 201 | [SerializeField] private List keys = new List(); 202 | [SerializeField] private List values = new List(); 203 | 204 | public SerializablePseudoDictionary3 (Dictionary baseDict) { 205 | var dict = new Dictionary(baseDict); 206 | 207 | keys = dict.Keys.ToList(); 208 | values = dict.Values.ToList(); 209 | } 210 | 211 | public void Add (string key, Vector2 val) { 212 | var dict = new Dictionary(); 213 | 214 | for (var i = 0; i < keys.Count; i++) { 215 | var currentKey = keys[i]; 216 | var currentVal = values[i]; 217 | dict[currentKey] = currentVal; 218 | } 219 | 220 | // add or update parameter. 221 | dict[key] = val; 222 | 223 | keys = new List(dict.Keys); 224 | values = new List(dict.Values); 225 | } 226 | 227 | public bool ContainsKey (string key) { 228 | var dict = new Dictionary(); 229 | 230 | for (var i = 0; i < keys.Count; i++) { 231 | var currentKey = keys[i]; 232 | var currentVal = values[i]; 233 | dict[currentKey] = currentVal; 234 | } 235 | 236 | return dict.ContainsKey(key); 237 | } 238 | 239 | public void Remove (string key) { 240 | var dict = new Dictionary(); 241 | 242 | for (var i = 0; i < keys.Count; i++) { 243 | var currentKey = keys[i]; 244 | var currentVal = values[i]; 245 | dict[currentKey] = currentVal; 246 | } 247 | 248 | dict.Remove(key); 249 | keys = new List(dict.Keys); 250 | values = new List(dict.Values); 251 | } 252 | 253 | public Dictionary ReadonlyDict () { 254 | var dict = new Dictionary(); 255 | if (keys == null) return dict; 256 | 257 | for (var i = 0; i < keys.Count; i++) { 258 | var key = keys[i]; 259 | var val = values[i]; 260 | dict[key] = val; 261 | } 262 | 263 | return dict; 264 | } 265 | } 266 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Libs/SerializablePseudoDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4de81d6333689420a815e7dfd7ce7643 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fdd3b5d5e5a249c0b5d67612c475f39 3 | folderAsset: yes 4 | timeCreated: 1471739898 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/BundlizerBase.cs: -------------------------------------------------------------------------------- 1 | // using UnityEngine; 2 | // using UnityEditor; 3 | 4 | // using System; 5 | // using System.IO; 6 | // using System.Linq; 7 | // using System.Collections.Generic; 8 | 9 | // namespace AssetGraph { 10 | // public class BundlizerBase : INodeOperationBase { 11 | // public void Setup (string nodeName, string nodeId, string labelToNext, string package, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 12 | // var outputDict = new Dictionary>(); 13 | 14 | // foreach (var groupKey in groupedSources.Keys) { 15 | // var outputSources = new List(); 16 | // outputDict[groupKey] = outputSources; 17 | // } 18 | 19 | // Output(nodeId, labelToNext, outputDict, new List()); 20 | // } 21 | 22 | // public void Run (string nodeName, string nodeId, string labelToNext, string package, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 23 | // var recommendedBundleOutputDir = FileUtility.PathCombine(AssetGraphSettings.BUNDLIZER_CACHE_PLACE, nodeId); 24 | // FileUtility.RemakeDirectory(recommendedBundleOutputDir); 25 | 26 | // var outputDict = new Dictionary>(); 27 | 28 | // foreach (var groupKey in groupedSources.Keys) { 29 | // var inputSources = groupedSources[groupKey]; 30 | 31 | // var assets = new List(); 32 | // foreach (var assetData in inputSources) { 33 | // var assetName = assetData.fileNameAndExtension; 34 | // var assetType = assetData.assetType; 35 | // var assetPath = assetData.importFrom; 36 | // var assetDatabaseId = assetData.assetDatabaseId; 37 | // assets.Add(new DepreacatedAssetInfo(assetName, assetType, assetPath, assetDatabaseId)); 38 | // } 39 | 40 | // var localFilePathsBeforeBundlize = FileUtility.FilePathsInFolder(AssetGraphSettings.UNITY_LOCAL_DATAPATH); 41 | // try { 42 | // In(groupKey, assets, recommendedBundleOutputDir); 43 | // } catch (Exception e) { 44 | // Debug.LogError("Bundlizer:" + this + " error:" + e); 45 | // } 46 | 47 | // AssetDatabase.Refresh(ImportAssetOptions.ImportRecursive); 48 | // AssetDatabase.SaveAssets(); 49 | 50 | // var localFilePathsAfterBundlize = FileUtility.FilePathsInFolder(AssetGraphSettings.UNITY_LOCAL_DATAPATH); 51 | 52 | // var outputSources = new List(); 53 | 54 | // var generatedAssetBundlePaths = localFilePathsAfterBundlize.Except(localFilePathsBeforeBundlize); 55 | 56 | // foreach (var newAssetPath in generatedAssetBundlePaths) { 57 | // if (GraphStackController.IsMetaFile(newAssetPath)) continue; 58 | // var newAssetData = Asset.InternalAssetDataGeneratedByImporterOrPrefabricator( 59 | // newAssetPath, 60 | // AssetDatabase.AssetPathToGUID(newAssetPath), 61 | // AssetGraphInternalFunctions.GetTypeOfAsset(newAssetPath), 62 | // true, 63 | // false 64 | // ); 65 | // outputSources.Add(newAssetData); 66 | // } 67 | 68 | // outputDict[groupKey] = outputSources; 69 | // } 70 | 71 | // Output(nodeId, labelToNext, outputDict, new List()); 72 | // } 73 | 74 | // public virtual void In (string groupkey, List source, string recommendedBundleOutputDir) { 75 | // Debug.LogError("should implement \"public override void In (List source, string recommendedBundleOutputDir)\" in class:" + this); 76 | // } 77 | // } 78 | // } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/BundlizerBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b92a5f777aad547b9816651b70a65462 3 | timeCreated: 1450270420 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/FilterBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | 7 | namespace AssetBundleGraph { 8 | public class FilterBase : INodeOperationBase { 9 | public void Setup (string nodeName, string connectionIdToNextNode, string _, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 10 | foreach (var groupKey in groupedSources.Keys) { 11 | 12 | var outputDict = new Dictionary>(); 13 | 14 | var inputSources = groupedSources[groupKey]; 15 | var absoluteSourcePaths = inputSources.Select(assetData => assetData.absoluteAssetPath).ToList(); 16 | 17 | Action> _PreOutput = (string label, List outputSources) => { 18 | var outputs = new List(); 19 | foreach (var outputSource in outputSources) { 20 | foreach (var inputSource in inputSources) { 21 | if (outputSource == inputSource.absoluteAssetPath) { 22 | outputs.Add(inputSource); 23 | } 24 | } 25 | } 26 | 27 | outputDict[groupKey] = outputs; 28 | Output(connectionIdToNextNode, label, outputDict, new List()); 29 | }; 30 | try { 31 | In(absoluteSourcePaths, _PreOutput); 32 | } catch (Exception e) { 33 | Debug.LogError(nodeName + " Error:" + e); 34 | } 35 | } 36 | } 37 | 38 | public void Run (string nodeName, string connectionIdToNextNode, string _, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 39 | foreach (var groupKey in groupedSources.Keys) { 40 | var outputDict = new Dictionary>(); 41 | 42 | var inputSources = groupedSources[groupKey]; 43 | 44 | var absoluteSourcePaths = inputSources.Select(assetData => assetData.absoluteAssetPath).ToList(); 45 | 46 | Action> _Output = (string label, List outputSources) => { 47 | var outputs = new List(); 48 | foreach (var outputSource in outputSources) { 49 | foreach (var inputSource in inputSources) { 50 | if (outputSource == inputSource.absoluteAssetPath) { 51 | outputs.Add(inputSource); 52 | } 53 | } 54 | } 55 | 56 | outputDict[groupKey] = outputs; 57 | Output(connectionIdToNextNode, label, outputDict, new List()); 58 | }; 59 | try { 60 | In(absoluteSourcePaths, _Output); 61 | } catch (Exception e) { 62 | Debug.LogError(nodeName + " Error:" + e); 63 | } 64 | } 65 | } 66 | 67 | 68 | /** 69 | フィルタに対して自動的に呼ばれる関数。 70 | */ 71 | public virtual void In (List source, Action> Out) { 72 | Debug.LogError("The filter class did not have \"In()\" method implemented. Please implement the method to filter:" + this); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/FilterBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9087ce42df01e48789342f8a2e699745 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/FinallyBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace AssetBundleGraph { 7 | public class FinallyBase { 8 | public virtual void Run (Dictionary>> throughputs, bool isRun) { 9 | Debug.Log("The Finally class did not have \"Run()\" method implemented. Please implement the method to do post process:" + this); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/FinallyBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe9083e3b7ad0446eaac2447e50f1530 3 | timeCreated: 1450270428 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/INodeOperationBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace AssetBundleGraph { 5 | /** 6 | interface of all nodes 7 | */ 8 | public interface INodeOperationBase { 9 | 10 | /** 11 | fire when setup. 12 | */ 13 | void Setup (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary> groupedSources, List alreadyCached, Action>, List> Output); 14 | 15 | /** 16 | fire when build. 17 | */ 18 | void Run (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary> groupedSources, List alreadyCached, Action>, List> Output); 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/INodeOperationBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 748b46ce4a3d64d6ab3dda262afc0651 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d0343273001a4643b108719a57550c1 3 | folderAsset: yes 4 | timeCreated: 1450270398 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIBundleBuilder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Collections.Generic; 8 | 9 | namespace AssetBundleGraph { 10 | public class IntegratedGUIBundleBuilder : INodeOperationBase { 11 | private readonly List bundleOptions; 12 | // private readonly List relatedNodeIds; 13 | 14 | public IntegratedGUIBundleBuilder (List bundleOptions, List relatedNodeIds) { 15 | this.bundleOptions = bundleOptions; 16 | // this.relatedNodeIds = relatedNodeIds; 17 | } 18 | 19 | public void Setup (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 20 | /* 21 | merge multi group into ["0"] group. 22 | */ 23 | var outputDict = new Dictionary>(); 24 | outputDict["0"] = new List(); 25 | 26 | foreach (var groupKey in groupedSources.Keys) { 27 | var outputSources = groupedSources[groupKey]; 28 | outputDict["0"].AddRange(outputSources); 29 | } 30 | 31 | Output(connectionIdToNextNode, labelToNext, outputDict, new List()); 32 | } 33 | 34 | public void Run (string nodeName, string connectionIdToNextNode, string labelToNext, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 35 | 36 | var recommendedBundleOutputDirSource = FileUtility.PathCombine(AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE, connectionIdToNextNode); 37 | var recommendedBundleOutputDir = FileUtility.PathCombine(recommendedBundleOutputDirSource, SystemDataUtility.GetCurrentPlatformKey()); 38 | if (!Directory.Exists(recommendedBundleOutputDir)) Directory.CreateDirectory(recommendedBundleOutputDir); 39 | 40 | 41 | /* 42 | merge multi group into ["0"] group. 43 | */ 44 | var intendedAssetNames = new List(); 45 | foreach (var groupKey in groupedSources.Keys) { 46 | var internalAssetsOfCurrentGroup = groupedSources[groupKey]; 47 | foreach (var internalAsset in internalAssetsOfCurrentGroup) { 48 | intendedAssetNames.Add(internalAsset.fileNameAndExtension); 49 | intendedAssetNames.Add(internalAsset.fileNameAndExtension + AssetBundleGraphSettings.MANIFEST_FOOTER); 50 | } 51 | } 52 | 53 | 54 | 55 | /* 56 | platform's bundle & manifest. 57 | e.g. iOS & iOS.manifest. 58 | */ 59 | var currentPlatform_Package_BundleFile = SystemDataUtility.GetCurrentPlatformKey(); 60 | var currentPlatform_Package_BundleFileManifest = currentPlatform_Package_BundleFile + AssetBundleGraphSettings.MANIFEST_FOOTER; 61 | 62 | intendedAssetNames.Add(currentPlatform_Package_BundleFile); 63 | intendedAssetNames.Add(currentPlatform_Package_BundleFileManifest); 64 | 65 | /* 66 | delete not intended assets. 67 | */ 68 | foreach (var alreadyCachedPath in alreadyCached) { 69 | var cachedFileName = Path.GetFileName(alreadyCachedPath); 70 | if (intendedAssetNames.Contains(cachedFileName)) continue; 71 | File.Delete(alreadyCachedPath); 72 | } 73 | 74 | var assetBundleOptions = BuildAssetBundleOptions.None; 75 | 76 | foreach (var enabled in bundleOptions) { 77 | switch (enabled) { 78 | case "Uncompressed AssetBundle": { 79 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.UncompressedAssetBundle; 80 | break; 81 | } 82 | case "Disable Write TypeTree": { 83 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.DisableWriteTypeTree; 84 | break; 85 | } 86 | case "Deterministic AssetBundle": { 87 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.DeterministicAssetBundle; 88 | break; 89 | } 90 | case "Force Rebuild AssetBundle": { 91 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.ForceRebuildAssetBundle; 92 | break; 93 | } 94 | case "Ignore TypeTree Changes": { 95 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.IgnoreTypeTreeChanges; 96 | break; 97 | } 98 | case "Append Hash To AssetBundle Name": { 99 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.AppendHashToAssetBundleName; 100 | break; 101 | } 102 | #if UNITY_5_3 103 | case "ChunkBased Compression": { 104 | assetBundleOptions = assetBundleOptions | BuildAssetBundleOptions.ChunkBasedCompression; 105 | break; 106 | } 107 | #endif 108 | } 109 | } 110 | 111 | BuildPipeline.BuildAssetBundles(recommendedBundleOutputDir, assetBundleOptions, EditorUserBuildSettings.activeBuildTarget); 112 | 113 | 114 | /* 115 | check assumed bundlized resources and actual generated assetbundles. 116 | 117 | "assuned bundlized resources info from bundlizer" are contained by "actual bundlized resources". 118 | */ 119 | var outputDict = new Dictionary>(); 120 | var outputSources = new List(); 121 | 122 | var newAssetPaths = new List(); 123 | var generatedAssetBundlePaths = FileUtility.FilePathsInFolder(recommendedBundleOutputDir); 124 | foreach (var newAssetPath in generatedAssetBundlePaths) { 125 | newAssetPaths.Add(newAssetPath); 126 | var newAssetData = Asset.CreateAssetWithImportPath(newAssetPath); 127 | outputSources.Add(newAssetData); 128 | } 129 | 130 | // compare, erase & notice. 131 | var containedAssetBundles = new List(); 132 | 133 | // collect intended output. 134 | foreach (var generatedAssetPath in newAssetPaths) { 135 | var generatedAssetName = Path.GetFileName(generatedAssetPath); 136 | 137 | // collect intended assetBundle & assetBundleManifest file. 138 | foreach (var bundledName in intendedAssetNames) { 139 | if (generatedAssetName == bundledName) { 140 | containedAssetBundles.Add(generatedAssetPath); 141 | continue; 142 | } 143 | 144 | var bundleManifestName = bundledName + AssetBundleGraphSettings.MANIFEST_FOOTER; 145 | if (generatedAssetName == bundleManifestName) { 146 | containedAssetBundles.Add(generatedAssetPath); 147 | continue; 148 | } 149 | } 150 | } 151 | 152 | var diffs = newAssetPaths.Except(containedAssetBundles); 153 | foreach (var diff in diffs) { 154 | Debug.LogWarning(nodeName +": AssetBundle " + diff + " is not intended to build. Check if unnecessary importer or prefabricator exists in the graph."); 155 | } 156 | 157 | outputDict["0"] = outputSources; 158 | 159 | var usedCache = new List(alreadyCached); 160 | Output(connectionIdToNextNode, labelToNext, outputDict, usedCache); 161 | } 162 | 163 | 164 | public static void RemoveAllAssetBundleSettings () { 165 | RemoveBundleSettings(AssetBundleGraphSettings.ASSETS_PATH); 166 | } 167 | 168 | public static void RemoveBundleSettings (string nodePath) { 169 | EditorUtility.DisplayProgressBar("AssetBundleGraph unbundlize all resources...", nodePath, 0); 170 | var filePathsInFolder = FileUtility.FilePathsInFolder(nodePath); 171 | foreach (var filePath in filePathsInFolder) { 172 | if (FileUtility.IsMetaFile(filePath)) { 173 | continue; 174 | } 175 | if (FileUtility.ContainsHiddenFiles(filePath)) { 176 | continue; 177 | } 178 | var assetImporter = AssetImporter.GetAtPath(filePath); 179 | 180 | // assetImporter is null when the asset is not accepted by Unity. 181 | // e.g. file.my_new_extension is ignored by Unity. 182 | if (assetImporter == null) continue; 183 | 184 | if (assetImporter.GetType() == typeof(UnityEditor.MonoImporter)) continue; 185 | 186 | assetImporter.assetBundleName = string.Empty; 187 | } 188 | EditorUtility.ClearProgressBar(); 189 | } 190 | } 191 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIBundleBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69577ba3a169a45bcaf35da94aa7b3d5 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIBundlizer.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace AssetBundleGraph { 9 | public class IntegratedGUIBundlizer : INodeOperationBase { 10 | private readonly string bundleNameTemplate; 11 | private readonly string assetsOutputConnectionId; 12 | private readonly Dictionary variants; 13 | 14 | public IntegratedGUIBundlizer (string bundleNameTemplate, string assetsConnectionId, Dictionary variants) { 15 | this.bundleNameTemplate = bundleNameTemplate; 16 | this.assetsOutputConnectionId = assetsConnectionId; 17 | this.variants = variants; 18 | } 19 | 20 | public void Setup (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 21 | 22 | try { 23 | ValidateBundleNameTemplate( 24 | bundleNameTemplate, 25 | () => { 26 | throw new NodeException(nodeName + ":Bundle Name Template is empty.", nodeId); 27 | } 28 | ); 29 | 30 | foreach(var name in variants.Values) { 31 | ValidateVariantName(name, variants.Values.ToList(), 32 | () => { 33 | throw new NodeException(nodeName + ":Variant is empty.", nodeId); 34 | }, 35 | () => { 36 | throw new NodeException(nodeName + ":Variant name cannot contain whitespace \"" + name + "\".", nodeId); 37 | }, 38 | () => { 39 | throw new NodeException(nodeName + ":Variant name already exists \"" + name + "\".", nodeId); 40 | }); 41 | } 42 | 43 | } catch (NodeException e) { 44 | AssetBundleGraphEditorWindow.AddNodeException(e); 45 | return; 46 | } 47 | 48 | var recommendedBundleOutputDir = FileUtility.PathCombine(AssetBundleGraphSettings.BUNDLIZER_CACHE_PLACE, nodeId, SystemDataUtility.GetCurrentPlatformKey()); 49 | 50 | var outputDict = new Dictionary>(); 51 | 52 | foreach (var groupKey in groupedSources.Keys) { 53 | var inputSources = groupedSources[groupKey]; 54 | 55 | var reservedBundlePath = BundlizeAssets(nodeName, groupKey, inputSources, recommendedBundleOutputDir, false); 56 | if (string.IsNullOrEmpty(reservedBundlePath)) { 57 | continue; 58 | } 59 | 60 | var outputSources = new List(); 61 | 62 | var newAssetData = Asset.CreateAssetWithImportPath(reservedBundlePath); 63 | 64 | outputSources.Add(newAssetData); 65 | 66 | outputDict[groupKey] = outputSources; 67 | } 68 | 69 | if (assetsOutputConnectionId != AssetBundleGraphSettings.BUNDLIZER_FAKE_CONNECTION_ID) { 70 | Output(nodeId, assetsOutputConnectionId, outputDict, new List()); 71 | } 72 | 73 | } 74 | 75 | public void Run (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 76 | ValidateBundleNameTemplate( 77 | bundleNameTemplate, 78 | () => { 79 | throw new AssetBundleGraphBuildException(nodeName + ": Bundle Name Template is empty."); 80 | } 81 | ); 82 | 83 | var recommendedBundleOutputDir = FileUtility.PathCombine(AssetBundleGraphSettings.BUNDLIZER_CACHE_PLACE, nodeId, SystemDataUtility.GetCurrentPlatformKey()); 84 | 85 | var outputDict = new Dictionary>(); 86 | 87 | foreach (var groupKey in groupedSources.Keys) { 88 | var inputSources = groupedSources[groupKey]; 89 | 90 | var reservedBundlePath = BundlizeAssets(nodeName, groupKey, inputSources, recommendedBundleOutputDir, true); 91 | if (string.IsNullOrEmpty(reservedBundlePath)) continue; 92 | 93 | var outputSources = new List(); 94 | 95 | var newAssetData = Asset.CreateAssetWithImportPath(reservedBundlePath); 96 | 97 | outputSources.Add(newAssetData); 98 | 99 | outputDict[groupKey] = outputSources; 100 | } 101 | 102 | if (assetsOutputConnectionId != AssetBundleGraphSettings.BUNDLIZER_FAKE_CONNECTION_ID) { 103 | Output(nodeId, assetsOutputConnectionId, outputDict, new List()); 104 | } 105 | 106 | } 107 | 108 | public string BundlizeAssets (string nodeName, string groupkey, List sources, string recommendedBundleOutputDir, bool isRun) { 109 | var invalids = new List(); 110 | foreach (var source in sources) { 111 | if (string.IsNullOrEmpty(source.importFrom)) { 112 | invalids.Add(source.absoluteAssetPath); 113 | } 114 | } 115 | if (invalids.Any()) { 116 | throw new AssetBundleGraphBuildException(nodeName + ": Invalid files to bundle. Following files need to be imported before bundlize: " + string.Join(", ", invalids.ToArray()) ); 117 | } 118 | 119 | var bundleName = bundleNameTemplate; 120 | 121 | /* 122 | if contains KEYWORD_WILDCARD, use group identifier to bundlize name. 123 | */ 124 | if (bundleNameTemplate.Contains(AssetBundleGraphSettings.KEYWORD_WILDCARD)) { 125 | var templateHead = bundleNameTemplate.Split(AssetBundleGraphSettings.KEYWORD_WILDCARD)[0]; 126 | var templateTail = bundleNameTemplate.Split(AssetBundleGraphSettings.KEYWORD_WILDCARD)[1]; 127 | 128 | bundleName = (templateHead + groupkey + templateTail + "." + SystemDataUtility.GetCurrentPlatformShortName()).ToLower(); 129 | } 130 | 131 | var bundlePath = FileUtility.PathCombine(recommendedBundleOutputDir, bundleName); 132 | 133 | for (var i = 0; i < sources.Count; i++) { 134 | var source = sources[i]; 135 | 136 | // if already bundled in this running, avoid changing that name. 137 | if (source.isBundled) { 138 | continue; 139 | } 140 | 141 | if (isRun) { 142 | if (FileUtility.IsMetaFile(source.importFrom)) continue; 143 | var assetImporter = AssetImporter.GetAtPath(source.importFrom); 144 | if (assetImporter == null) continue; 145 | assetImporter.assetBundleName = bundleName; 146 | } 147 | 148 | // set as this resource is already bundled. 149 | sources[i] = Asset.DuplicateAssetWithNewStatus(sources[i], sources[i].isNew, true); 150 | } 151 | 152 | return bundlePath; 153 | } 154 | 155 | public static void ValidateBundleNameTemplate (string bundleNameTemplate, Action NullOrEmpty) { 156 | if (string.IsNullOrEmpty(bundleNameTemplate)) NullOrEmpty(); 157 | } 158 | 159 | public static void ValidateVariantName (string variantName, List names, Action NullOrEmpty, Action ContainsSpace, Action NameAlreadyExists) { 160 | if (string.IsNullOrEmpty(variantName)) { 161 | NullOrEmpty(); 162 | } 163 | if(Regex.IsMatch(variantName, "\\s")) { 164 | ContainsSpace(); 165 | } 166 | var overlappings = names.GroupBy(x => x) 167 | .Where(group => 1 < group.Count()) 168 | .Select(group => group.Key) 169 | .ToList(); 170 | 171 | if (overlappings.Any()) { 172 | NameAlreadyExists(); 173 | } 174 | } 175 | } 176 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIBundlizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66a0b433651e34731959e2267dc8e3a2 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIExporter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Collections.Generic; 7 | 8 | namespace AssetBundleGraph { 9 | public class IntegratedGUIExporter : INodeOperationBase { 10 | private readonly string exportFilePath; 11 | 12 | public IntegratedGUIExporter (string exportFilePath) { 13 | this.exportFilePath = exportFilePath; 14 | } 15 | 16 | public void Setup (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 17 | 18 | try { 19 | ValidateExportPath( 20 | exportFilePath, 21 | exportFilePath, 22 | () => { 23 | throw new NodeException(nodeName + ":Export Path is empty.", nodeId); 24 | }, 25 | () => { 26 | throw new NodeException(nodeName + ":Directory set to Export Path does not exist. Path:" + exportFilePath, nodeId); 27 | } 28 | ); 29 | } catch(NodeException e) { 30 | AssetBundleGraphEditorWindow.AddNodeException(e); 31 | return; 32 | } 33 | 34 | Export(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output, false); 35 | } 36 | 37 | public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 38 | ValidateExportPath( 39 | exportFilePath, 40 | exportFilePath, 41 | () => { 42 | throw new AssetBundleGraphBuildException(nodeName + ":Export Path is empty."); 43 | }, 44 | () => { 45 | throw new AssetBundleGraphBuildException(nodeName + ":Directory set to Export Path does not exist. Path:" + exportFilePath); 46 | } 47 | ); 48 | 49 | Export(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output, true); 50 | } 51 | 52 | private void Export (string nodeName, string nodeId, string labelToNext, Dictionary> groupedSources, Action>, List> Output, bool isRun) { 53 | var outputDict = new Dictionary>(); 54 | outputDict["0"] = new List(); 55 | 56 | var failedExports = new List(); 57 | 58 | foreach (var groupKey in groupedSources.Keys) { 59 | var exportedAssets = new List(); 60 | var inputSources = groupedSources[groupKey]; 61 | 62 | foreach (var source in inputSources) { 63 | if (isRun) { 64 | if (!Directory.Exists(exportFilePath)) { 65 | Directory.CreateDirectory(exportFilePath); 66 | } 67 | } 68 | 69 | var destinationSourcePath = source.importFrom; 70 | 71 | // in bundleBulider, use platform-package folder for export destination. 72 | if (destinationSourcePath.StartsWith(AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE)) { 73 | var depth = AssetBundleGraphSettings.BUNDLEBUILDER_CACHE_PLACE.Split(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR).Length + 1; 74 | 75 | var splitted = destinationSourcePath.Split(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR); 76 | var reducedArray = new string[splitted.Length - depth]; 77 | 78 | Array.Copy(splitted, depth, reducedArray, 0, reducedArray.Length); 79 | var fromDepthToEnd = string.Join(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR.ToString(), reducedArray); 80 | 81 | destinationSourcePath = fromDepthToEnd; 82 | } 83 | 84 | var destination = FileUtility.PathCombine(exportFilePath, destinationSourcePath); 85 | 86 | var parentDir = Directory.GetParent(destination).ToString(); 87 | 88 | if (isRun) { 89 | if (!Directory.Exists(parentDir)) { 90 | Directory.CreateDirectory(parentDir); 91 | } 92 | if (File.Exists(destination)) { 93 | File.Delete(destination); 94 | } 95 | if (string.IsNullOrEmpty(source.importFrom)) { 96 | failedExports.Add(source.absoluteAssetPath); 97 | continue; 98 | } 99 | try { 100 | File.Copy(source.importFrom, destination); 101 | } catch(Exception e) { 102 | failedExports.Add(source.importFrom); 103 | Debug.LogError(nodeName + ": Error occured: " + e.Message); 104 | } 105 | } 106 | 107 | var exportedAsset = Asset.CreateAssetWithExportPath(destination); 108 | exportedAssets.Add(exportedAsset); 109 | } 110 | outputDict["0"].AddRange(exportedAssets); 111 | } 112 | 113 | if (failedExports.Any()) { 114 | Debug.LogError(nodeName + ": Failed to export files. All files must be imported before exporting: " + string.Join(", ", failedExports.ToArray())); 115 | } 116 | 117 | Output(nodeId, labelToNext, outputDict, new List()); 118 | } 119 | 120 | public static bool ValidateExportPath (string currentExportFilePath, string combinedPath, Action NullOrEmpty, Action DoesNotExist) { 121 | if (string.IsNullOrEmpty(currentExportFilePath)) { 122 | NullOrEmpty(); 123 | return false; 124 | } 125 | if (!Directory.Exists(combinedPath)) { 126 | DoesNotExist(); 127 | return false; 128 | } 129 | return true; 130 | } 131 | } 132 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIExporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e90c275e75d24c1eab9e3c1dbd31f6b 3 | timeCreated: 1450270417 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIFilter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace AssetBundleGraph { 9 | public class IntegratedGUIFilter : INodeOperationBase { 10 | private readonly string[] connectionIdsFromThisNodeToChildNodesOrFakeIds; 11 | private readonly List containsKeywords; 12 | private readonly List containsKeytypes; 13 | public IntegratedGUIFilter (string[] connectionIdsFromThisNodeToChildNodes, List containsKeywords, List containsKeytypes) { 14 | this.connectionIdsFromThisNodeToChildNodesOrFakeIds = connectionIdsFromThisNodeToChildNodes; 15 | this.containsKeywords = containsKeywords; 16 | this.containsKeytypes = containsKeytypes; 17 | } 18 | 19 | public void Setup (string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 20 | // overlapping test. 21 | var overlappingCheckList = new List(); 22 | for (var i = 0; i < containsKeywords.Count; i++) { 23 | var keywordAndKeytypeCombind = containsKeywords[i] + containsKeytypes[i]; 24 | if (overlappingCheckList.Contains(keywordAndKeytypeCombind)) { 25 | throw new NodeException(String.Format("Duplicated filter condition found for [Keyword:{0} Type:{1}]", containsKeywords[i], containsKeytypes[i]), nodeId); 26 | } 27 | overlappingCheckList.Add(keywordAndKeytypeCombind); 28 | } 29 | 30 | foreach (var groupKey in groupedSources.Keys) { 31 | var outputDict = new Dictionary>(); 32 | 33 | var inputSources = groupedSources[groupKey]; 34 | 35 | Action> _PreOutput = (string connectionId, List outputSources) => { 36 | var outputs = new List(); 37 | 38 | foreach (var outputSource in outputSources) { 39 | foreach (var inputSource in inputSources) { 40 | if (outputSource == inputSource.GetAbsolutePathOrImportedPath()) { 41 | outputs.Add(inputSource); 42 | } 43 | } 44 | } 45 | 46 | outputDict[groupKey] = outputs; 47 | Output(nodeId, connectionId, outputDict, new List()); 48 | }; 49 | 50 | try { 51 | Filter(inputSources, _PreOutput); 52 | } catch (Exception e) { 53 | Debug.LogError(nodeName + " Error:" + e); 54 | } 55 | } 56 | } 57 | 58 | public void Run (string nodeName, string nodeId, string nused_connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 59 | // overlapping test. 60 | var overlappingCheckList = new List(); 61 | for (var i = 0; i < containsKeywords.Count; i++) { 62 | var keywordAndKeytypeCombind = containsKeywords[i] + containsKeytypes[i]; 63 | if (overlappingCheckList.Contains(keywordAndKeytypeCombind)) { 64 | throw new NodeException(String.Format("Duplicated filter condition found for [Keyword:{0} Type:{1}]", containsKeywords[i], containsKeytypes[i]), nodeId); 65 | } 66 | overlappingCheckList.Add(keywordAndKeytypeCombind); 67 | } 68 | 69 | foreach (var groupKey in groupedSources.Keys) { 70 | var outputDict = new Dictionary>(); 71 | 72 | var inputSources = groupedSources[groupKey]; 73 | 74 | Action> _Output = (string connectionId, List outputSources) => { 75 | var outputs = new List(); 76 | 77 | foreach (var outputSource in outputSources) { 78 | foreach (var inputSource in inputSources) { 79 | if (outputSource == inputSource.GetAbsolutePathOrImportedPath()) { 80 | outputs.Add(inputSource); 81 | } 82 | } 83 | } 84 | 85 | outputDict[groupKey] = outputs; 86 | Output(nodeId, connectionId, outputDict, new List()); 87 | }; 88 | 89 | try { 90 | Filter(inputSources, _Output); 91 | } catch (Exception e) { 92 | Debug.LogError(nodeName + " Error:" + e); 93 | } 94 | } 95 | } 96 | 97 | private class ExhaustiveAssetPathData { 98 | public readonly string importFrom; 99 | public readonly string absoluteAssetPath; 100 | public bool isFilterExhausted = false; 101 | 102 | public ExhaustiveAssetPathData (string absoluteAssetPath, string importFrom) { 103 | this.importFrom = importFrom; 104 | this.absoluteAssetPath = absoluteAssetPath; 105 | } 106 | } 107 | 108 | private void Filter (List assets, Action> FilterResultReceiver) { 109 | var exhaustiveAssets = new List(); 110 | foreach (var asset in assets) { 111 | exhaustiveAssets.Add(new ExhaustiveAssetPathData(asset.absoluteAssetPath, asset.importFrom)); 112 | } 113 | 114 | for (var i = 0; i < connectionIdsFromThisNodeToChildNodesOrFakeIds.Length; i++) { 115 | // these 3 parameters depends on their contents order. 116 | var connectionId = connectionIdsFromThisNodeToChildNodesOrFakeIds[i]; 117 | var keyword = containsKeywords[i]; 118 | var keytype = containsKeytypes[i]; 119 | 120 | // filter by keyword first 121 | List keywordContainsAssets = exhaustiveAssets.Where( 122 | assetData => 123 | !assetData.isFilterExhausted && 124 | Regex.IsMatch(assetData.importFrom, keyword, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace) 125 | ).ToList(); 126 | 127 | var typeMatchedAssetsAbsolutePaths = new List(); 128 | 129 | // then, filter by type 130 | foreach (var containedAssetData in keywordContainsAssets) { 131 | if (keytype != AssetBundleGraphSettings.DEFAULT_FILTER_KEYTYPE) { 132 | var assumedType = TypeUtility.FindTypeOfAsset(containedAssetData.importFrom); 133 | if (assumedType == null || keytype != assumedType.ToString()) { 134 | continue; 135 | } 136 | } 137 | typeMatchedAssetsAbsolutePaths.Add(containedAssetData.absoluteAssetPath); 138 | } 139 | 140 | // mark assets as exhausted. 141 | foreach (var exhaustiveAsset in exhaustiveAssets) { 142 | if (typeMatchedAssetsAbsolutePaths.Contains(exhaustiveAsset.absoluteAssetPath)) { 143 | exhaustiveAsset.isFilterExhausted = true; 144 | } 145 | } 146 | 147 | if (connectionId != AssetBundleGraphSettings.FILTER_FAKE_CONNECTION_ID) { 148 | FilterResultReceiver(connectionId, typeMatchedAssetsAbsolutePaths); 149 | } 150 | } 151 | } 152 | 153 | 154 | 155 | public static void ValidateFilter (string currentFilterKeyword, List keywords, Action NullOrEmpty, Action AlreadyContained) { 156 | if (string.IsNullOrEmpty(currentFilterKeyword)) NullOrEmpty(); 157 | if (keywords.Contains(currentFilterKeyword)) AlreadyContained(); 158 | } 159 | } 160 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad7f526afe0f242cabf84feb76ab7a46 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIGrouping.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text.RegularExpressions; 5 | 6 | namespace AssetBundleGraph 7 | { 8 | public class IntegratedGUIGrouping : INodeOperationBase { 9 | private readonly string groupingKeyword; 10 | 11 | public IntegratedGUIGrouping (string groupingKeyword) { 12 | this.groupingKeyword = groupingKeyword; 13 | } 14 | 15 | public void Setup (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 16 | GroupingOutput(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output); 17 | } 18 | 19 | public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, List alreadyCached, Action>, List> Output) { 20 | GroupingOutput(nodeName, nodeId, connectionIdToNextNode, groupedSources, Output); 21 | } 22 | 23 | 24 | private void GroupingOutput (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> groupedSources, Action>, List> Output) { 25 | 26 | try { 27 | ValidateGroupingKeyword( 28 | groupingKeyword, 29 | () => { 30 | throw new NodeException("Grouping Keyword can not be empty.", nodeId); 31 | }, 32 | () => { 33 | throw new NodeException(String.Format("Grouping Keyword must contain {0} for numbering: currently {1}", AssetBundleGraphSettings.KEYWORD_WILDCARD, groupingKeyword), nodeId); 34 | } 35 | ); 36 | } catch(NodeException e) { 37 | AssetBundleGraphEditorWindow.AddNodeException(e); 38 | return; 39 | } 40 | 41 | var outputDict = new Dictionary>(); 42 | 43 | var mergedGroupedSources = new List(); 44 | 45 | foreach (var groupKey in groupedSources.Keys) { 46 | mergedGroupedSources.AddRange(groupedSources[groupKey]); 47 | } 48 | 49 | foreach (var source in mergedGroupedSources) { 50 | var targetPath = source.GetAbsolutePathOrImportedPath(); 51 | 52 | var groupingKeywordPrefix = groupingKeyword.Split(AssetBundleGraphSettings.KEYWORD_WILDCARD)[0]; 53 | var groupingKeywordPostfix = groupingKeyword.Split(AssetBundleGraphSettings.KEYWORD_WILDCARD)[1]; 54 | 55 | var regex = new Regex(groupingKeywordPrefix + "(.*?)" + groupingKeywordPostfix); 56 | var match = regex.Match(targetPath); 57 | 58 | if (match.Success) { 59 | var newGroupingKey = match.Groups[1].Value; 60 | if (!outputDict.ContainsKey(newGroupingKey)) outputDict[newGroupingKey] = new List(); 61 | outputDict[newGroupingKey].Add(source); 62 | } 63 | } 64 | 65 | Output(nodeId, connectionIdToNextNode, outputDict, new List()); 66 | } 67 | 68 | public static void ValidateGroupingKeyword (string currentGroupingKeyword, Action NullOrEmpty, Action ShouldContainWildCardKey) { 69 | if (string.IsNullOrEmpty(currentGroupingKeyword)) NullOrEmpty(); 70 | if (!currentGroupingKeyword.Contains(AssetBundleGraphSettings.KEYWORD_WILDCARD.ToString())) ShouldContainWildCardKey(); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIGrouping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ab08bf4e799d4117a014e6f428809f8 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIImportSetting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc44e03237c4e477bac5d175b58c90a9 3 | timeCreated: 1460558043 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUILoader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | using System; 4 | using System.IO; 5 | using System.Collections.Generic; 6 | using UnityEditor; 7 | 8 | namespace AssetBundleGraph { 9 | public class IntegratedGUILoader : INodeOperationBase { 10 | private readonly string loadFilePath; 11 | 12 | public IntegratedGUILoader (string loadFilePath) { 13 | this.loadFilePath = loadFilePath; 14 | } 15 | 16 | public void Setup (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> unused, List alreadyCached, Action>, List> Output) { 17 | 18 | try { 19 | ValidateLoadPath( 20 | loadFilePath, 21 | loadFilePath, 22 | () => { 23 | //throw new NodeException(nodeName + ": Load Path is empty.", nodeId); 24 | }, 25 | () => { 26 | throw new NodeException(nodeName + ": Directory not found: " + loadFilePath, nodeId); 27 | } 28 | ); 29 | } catch(NodeException e) { 30 | AssetBundleGraphEditorWindow.AddNodeException(e); 31 | return; 32 | } 33 | 34 | // SOMEWHERE_FULLPATH/PROJECT_FOLDER/Assets/ 35 | var assetsFolderPath = Application.dataPath + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; 36 | 37 | var outputSource = new List(); 38 | var targetFilePaths = FileUtility.FilePathsInFolder(loadFilePath); 39 | 40 | try { 41 | foreach (var targetFilePath in targetFilePaths) { 42 | 43 | if(targetFilePath.Contains(AssetBundleGraphSettings.ASSETBUNDLEGRAPH_PATH)) { 44 | continue; 45 | } 46 | 47 | // already contained into Assets/ folder. 48 | // imported path is Assets/SOMEWHERE_FILE_EXISTS. 49 | if (targetFilePath.StartsWith(assetsFolderPath)) { 50 | var relativePath = targetFilePath.Replace(assetsFolderPath, AssetBundleGraphSettings.ASSETS_PATH); 51 | 52 | var assetType = TypeUtility.GetTypeOfAsset(relativePath); 53 | if (assetType == typeof(object)) { 54 | continue; 55 | } 56 | 57 | outputSource.Add(Asset.CreateNewAssetFromLoader(targetFilePath, relativePath)); 58 | continue; 59 | } 60 | 61 | throw new NodeException(nodeName + ": Invalid Load Path. Path must start with Assets/", nodeId); 62 | } 63 | } catch(NodeException e) { 64 | AssetBundleGraphEditorWindow.AddNodeException(e); 65 | return; 66 | } 67 | catch (Exception e) { 68 | Debug.LogError(nodeName + " Error:" + e); 69 | } 70 | 71 | var outputDir = new Dictionary> { 72 | {"0", outputSource} 73 | }; 74 | 75 | Output(nodeId, connectionIdToNextNode, outputDir, new List()); 76 | } 77 | 78 | public void Run (string nodeName, string nodeId, string connectionIdToNextNode, Dictionary> unused, List alreadyCached, Action>, List> Output) { 79 | ValidateLoadPath( 80 | loadFilePath, 81 | loadFilePath, 82 | () => { 83 | //throw new AssetBundleGraphBuildException(nodeName + ": Load Path is empty."); 84 | }, 85 | () => { 86 | throw new AssetBundleGraphBuildException(nodeName + ": Directory not found: " + loadFilePath); 87 | } 88 | ); 89 | 90 | // SOMEWHERE_FULLPATH/PROJECT_FOLDER/Assets/ 91 | var assetsFolderPath = Application.dataPath + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; 92 | 93 | var outputSource = new List(); 94 | try { 95 | var targetFilePaths = FileUtility.FilePathsInFolder(loadFilePath); 96 | 97 | foreach (var targetFilePath in targetFilePaths) { 98 | 99 | if(targetFilePath.Contains(AssetBundleGraphSettings.ASSETBUNDLEGRAPH_PATH)) { 100 | continue; 101 | } 102 | 103 | // already contained into Assets/ folder. 104 | // imported path is Assets/SOMEWHERE_FILE_EXISTS. 105 | if (targetFilePath.StartsWith(assetsFolderPath)) { 106 | var importFrom = targetFilePath.Replace(assetsFolderPath, AssetBundleGraphSettings.ASSETS_PATH); 107 | 108 | outputSource.Add(Asset.CreateNewAssetFromLoader(targetFilePath, importFrom)); 109 | continue; 110 | } 111 | 112 | throw new AssetBundleGraphSetupException(nodeName + ": Invalid target file path. Path needs to be set under Assets/ :" + targetFilePath); 113 | } 114 | 115 | var outputDir = new Dictionary> { 116 | {"0", outputSource} 117 | }; 118 | 119 | Output(nodeId, connectionIdToNextNode, outputDir, new List()); 120 | } catch (Exception e) { 121 | throw new NodeException(e.Message, nodeId); 122 | } 123 | } 124 | 125 | public static void ValidateLoadPath (string currentLoadPath, string combinedPath, Action NullOrEmpty, Action NotExist) { 126 | if (string.IsNullOrEmpty(currentLoadPath)) NullOrEmpty(); 127 | if (!Directory.Exists(combinedPath)) NotExist(); 128 | } 129 | } 130 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUILoader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b4b6bfef994f41ad9072f0b81efcb7b 3 | timeCreated: 1450270419 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/IntegratedGUIModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d85d995cf6a1e474a9bbf5d39e4282e8 3 | timeCreated: 1471584375 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/InternalSamplingImportEffector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74662a5f71ab746b1b23ea9d1602c25a 3 | timeCreated: 1460559671 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89f61c8b6aad4473bbce77069a219c71 3 | folderAsset: yes 4 | timeCreated: 1471739048 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AnimationOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class AnimationOperator : OperatorBase { 9 | 10 | public AnimationOperator () {} 11 | 12 | private AnimationOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new AnimationOperator( 23 | "UnityEngine.Animation" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var animation = asset as Animation; 29 | 30 | var changed = false; 31 | 32 | /* 33 | Variables 34 | 35 | animatePhysics When turned on, animations will be executed in the physics loop. This is only useful in conjunction with kinematic rigidbodies. 36 | clip The default animation. 37 | cullingType Controls culling of this Animation component. 38 | isPlaying Are we playing any animations? 39 | localBounds AABB of this Animation animation component in local space. 40 | playAutomatically Should the default animation clip (the Animation.clip property) automatically start playing on startup? 41 | this[string] Returns the animation state named name. 42 | wrapMode How should time beyond the playback range of the clip be treated? 43 | */ 44 | 45 | return changed; 46 | } 47 | 48 | public override void Modify (T asset) { 49 | var flare = asset as Shader; 50 | 51 | } 52 | 53 | public override void DrawInspector (Action changed) { 54 | GUILayout.Label("AnimationOperator inspector."); 55 | } 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AnimationOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 979b36029a25847458c2eb8725998f42 3 | timeCreated: 1472558529 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AnimatorOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class AnimatorOperator : OperatorBase { 9 | 10 | public AnimatorOperator () {} 11 | 12 | private AnimatorOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | 17 | // this.wrapMode = wrapMode; 18 | // this.filterMode = filterMode; 19 | // this.anisoLevel = anisoLevel; 20 | } 21 | 22 | /* 23 | constructor for default data setting. 24 | */ 25 | public override OperatorBase DefaultSetting () { 26 | return new AnimatorOperator( 27 | "UnityEngine.Animator" 28 | ); 29 | } 30 | 31 | public override bool IsChanged (T asset) { 32 | var animator = asset as Animator; 33 | 34 | var changed = false; 35 | 36 | /* 37 | Variables 38 | 39 | angularVelocity Gets the avatar angular velocity for the last evaluated frame. 40 | applyRootMotion Should root motion be applied? 41 | avatar Gets/Sets the current Avatar. 42 | bodyPosition The position of the body center of mass. 43 | bodyRotation The rotation of the body center of mass. 44 | cullingMode Controls culling of this Animator component. 45 | deltaPosition Gets the avatar delta position for the last evaluated frame. 46 | deltaRotation Gets the avatar delta rotation for the last evaluated frame. 47 | feetPivotActive Blends pivot point between body center of mass and feet pivot. At 0%, the blending point is body center of mass. At 100%, the blending point is feet pivot. 48 | gravityWeight The current gravity weight based on current animations that are played. 49 | hasRootMotion Returns true if the current rig has root motion. 50 | hasTransformHierarchy Returns true if the object has a transform hierarchy. 51 | humanScale Returns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic). 52 | isHuman Returns true if the current rig is humanoid, false if it is generic. 53 | isInitialized Returns whether the animator is initialized successfully. 54 | isMatchingTarget If automatic matching is active. 55 | isOptimizable Returns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy. 56 | layerCount See IAnimatorControllerPlayable.layerCount. 57 | layersAffectMassCenter Additional layers affects the center of mass. 58 | leftFeetBottomHeight Get left foot bottom height. 59 | linearVelocityBlending When linearVelocityBlending is set to true, the root motion velocity and angular velocity will be blended linearly. 60 | parameterCount See IAnimatorControllerPlayable.parameterCount. 61 | parameters Read only acces to the AnimatorControllerParameters used by the animator. 62 | pivotPosition Get the current position of the pivot. 63 | pivotWeight Gets the pivot weight. 64 | playbackTime Sets the playback position in the recording buffer. 65 | recorderMode Gets the mode of the Animator recorder. 66 | recorderStartTime Start time of the first frame of the buffer relative to the frame at which StartRecording was called. 67 | recorderStopTime End time of the recorded clip relative to when StartRecording was called. 68 | rightFeetBottomHeight Get right foot bottom height. 69 | rootPosition The root position, the position of the game object. 70 | rootRotation The root rotation, the rotation of the game object. 71 | runtimeAnimatorController The runtime representation of AnimatorController that controls the Animator. 72 | speed The playback speed of the Animator. 1 is normal playback speed. 73 | stabilizeFeet Automatic stabilization of feet during transition and blending. 74 | targetPosition Returns the position of the target specified by SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)). 75 | targetRotation Returns the rotation of the target specified by SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)). 76 | updateMode Specifies the update mode of the Animator. 77 | velocity Gets the avatar velocity for the last evaluated frame. 78 | */ 79 | 80 | return changed; 81 | } 82 | 83 | public override void Modify (T asset) { 84 | var flare = asset as Shader; 85 | 86 | } 87 | 88 | public override void DrawInspector (Action changed) { 89 | GUILayout.Label("AnimatorOperator inspector."); 90 | } 91 | } 92 | 93 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AnimatorOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e683f23c5a07439fb9e6a336c04927d 3 | timeCreated: 1472558529 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AvatarMaskOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEditor.Animations; 5 | using UnityEngine; 6 | 7 | namespace AssetBundleGraph.ModifierOperators { 8 | 9 | [Serializable] public class AvatarMaskOperator : OperatorBase { 10 | 11 | public AvatarMaskOperator () {} 12 | 13 | private AvatarMaskOperator ( 14 | string operatorType 15 | ) { 16 | this.operatorType = operatorType; 17 | } 18 | 19 | /* 20 | constructor for default data setting. 21 | */ 22 | public override OperatorBase DefaultSetting () { 23 | return new AvatarMaskOperator( 24 | "UnityEditor.Animations.AvatarMask" 25 | ); 26 | } 27 | 28 | public override bool IsChanged (T asset) { 29 | var avarar = asset as AvatarMask; 30 | 31 | var changed = false; 32 | 33 | return changed; 34 | } 35 | 36 | public override void Modify (T asset) { 37 | var avarar = asset as AvatarMask; 38 | 39 | } 40 | 41 | public override void DrawInspector (Action changed) { 42 | GUILayout.Label("AvatarMaskOperator inspector."); 43 | } 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/AvatarMaskOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7021c06760c4e4fe08ce149d84f79297 3 | timeCreated: 1472559196 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/CubemapOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class CubemapOperator : OperatorBase { 9 | 10 | public CubemapOperator () {} 11 | 12 | private CubemapOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new CubemapOperator( 23 | "UnityEngine.Cubemap" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var cubemap = asset as Cubemap; 29 | 30 | var changed = false; 31 | 32 | return changed; 33 | } 34 | 35 | public override void Modify (T asset) { 36 | var cubemap = asset as Cubemap; 37 | 38 | } 39 | 40 | public override void DrawInspector (Action changed) { 41 | GUILayout.Label("CubemapOperator inspector."); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/CubemapOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e52a93af08e36436fb3e9fa1e7507bb8 3 | timeCreated: 1472556027 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/FlareOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class FlareOperator : OperatorBase { 9 | 10 | public FlareOperator () {} 11 | 12 | private FlareOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new FlareOperator( 23 | "UnityEngine.Flare" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var flare = asset as Flare; 29 | 30 | var changed = false; 31 | 32 | return changed; 33 | } 34 | 35 | public override void Modify (T asset) { 36 | var flare = asset as Flare; 37 | 38 | } 39 | 40 | public override void DrawInspector (Action changed) { 41 | GUILayout.Label("FlareOperator inspector."); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/FlareOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44c3097be84ac4f3eafb95ddf98441b0 3 | timeCreated: 1472556027 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/FontOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class FontOperator : OperatorBase { 9 | 10 | public FontOperator () {} 11 | 12 | private FontOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new FontOperator( 23 | "UnityEngine.Font" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var font = asset as Font; 29 | 30 | var changed = false; 31 | 32 | /* 33 | Variables 34 | 35 | ascent The ascent of the font. 36 | characterInfo Access an array of all characters contained in the font texture. 37 | dynamic Is the font a dynamic font. 38 | fontSize The default size of the font. 39 | lineHeight The line height of the font. 40 | material The material used for the font display. 41 | */ 42 | 43 | return changed; 44 | } 45 | 46 | public override void Modify (T asset) { 47 | var font = asset as Font; 48 | 49 | } 50 | 51 | public override void DrawInspector (Action changed) { 52 | GUILayout.Label("FontOperator inspector."); 53 | } 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/FontOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd8d325207d7a4c33bebdd5cdfa88f92 3 | timeCreated: 1472556027 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/GUISkinOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class GUISkinOperator : OperatorBase { 9 | 10 | public GUISkinOperator () {} 11 | 12 | private GUISkinOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new GUISkinOperator( 23 | "UnityEngine.GUISkin" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var guiSkin = asset as GUISkin; 29 | 30 | var changed = false; 31 | 32 | return changed; 33 | } 34 | 35 | public override void Modify (T asset) { 36 | var guiSkin = asset as GUISkin; 37 | 38 | } 39 | 40 | public override void DrawInspector (Action changed) { 41 | GUILayout.Label("GUISkinOperator inspector."); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/GUISkinOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4f836cb10afc486590cb68027e0467f 3 | timeCreated: 1472556027 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/MaterialOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39126cf31170245f4bf95c76caf403da 3 | timeCreated: 1472493118 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/OperatorBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace AssetBundleGraph.ModifierOperators { 5 | /* 6 | this class is base class of ModifierOperator. 7 | every operator should extend this class and implement these virtual methods. 8 | */ 9 | [Serializable] public class OperatorBase { 10 | [SerializeField] public string operatorType; 11 | 12 | public OperatorBase () {}// this class is required for serialization. and reflextion 13 | 14 | public virtual OperatorBase DefaultSetting () { 15 | throw new Exception("should override DefaultSetting method."); 16 | } 17 | 18 | public virtual bool IsChanged (T asset) { 19 | throw new Exception("should override IsChanged method."); 20 | } 21 | 22 | public virtual void Modify (T asset) { 23 | throw new Exception("should override Modify method."); 24 | } 25 | 26 | public virtual void DrawInspector (Action changed) { 27 | throw new Exception("should override DrawInspector method."); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/OperatorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ad03d9254cd64e3aa516eaceb951d61 3 | timeCreated: 1471683036 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/PhysicMaterialOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class PhysicMaterialOperator : OperatorBase { 9 | 10 | public PhysicMaterialOperator () {} 11 | 12 | private PhysicMaterialOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new PhysicMaterialOperator( 23 | "UnityEngine.PhysicMaterial" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var physicMaterial = asset as PhysicMaterial; 29 | 30 | var changed = false; 31 | 32 | /* 33 | Variables 34 | 35 | bounceCombine Determines how the bounciness is combined. 36 | bounciness How bouncy is the surface? A value of 0 will not bounce. A value of 1 will bounce without any loss of energy. 37 | dynamicFriction The friction used when already moving. This value has to be between 0 and 1. 38 | frictionCombine Determines how the friction is combined. 39 | staticFriction The friction coefficient used when an object is lying on a surface. 40 | */ 41 | 42 | return changed; 43 | } 44 | 45 | public override void Modify (T asset) { 46 | var physicMaterial = asset as PhysicMaterial; 47 | 48 | } 49 | 50 | public override void DrawInspector (Action changed) { 51 | GUILayout.Label("PhysicMaterialOperator inspector."); 52 | } 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/PhysicMaterialOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef34b1acdbf484700876c4342716c821 3 | timeCreated: 1472557392 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/PhysicsMaterial2DOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class PhysicsMaterial2DOperator : OperatorBase { 9 | 10 | public PhysicsMaterial2DOperator () {} 11 | 12 | private PhysicsMaterial2DOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new PhysicsMaterial2DOperator( 23 | "UnityEngine.PhysicsMaterial2D" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var physicsMaterial2D = asset as PhysicsMaterial2D; 29 | 30 | var changed = false; 31 | 32 | /* 33 | Variables 34 | 35 | bounciness The degree of elasticity during collisions. 36 | friction Coefficient of friction. 37 | */ 38 | 39 | return changed; 40 | } 41 | 42 | public override void Modify (T asset) { 43 | var physicsMaterial2D = asset as PhysicsMaterial2D; 44 | 45 | } 46 | 47 | public override void DrawInspector (Action changed) { 48 | GUILayout.Label("PhysicsMaterial2DOperator inspector."); 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/PhysicsMaterial2DOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 937db2261271143fa95dc1e8c43c3b6b 3 | timeCreated: 1472558529 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/RenderTextureOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | /* 8 | paramter definitions for RenderTexture. 9 | 10 | このクラスの設定方法と役割 11 | 0.TypeUtility.csのSupportedModifierOperationDefinitionに、 12 | サポートしたいAsset型をGetType().ToString()した文字列をkey、このクラスのTypeをvalueとして設定する。 13 | 14 | 例:RenderTextureのModify処理をこのクラスで対応するようにしたい場合、 15 | {"UnityEngine.RenderTexture", typeof(ModifierOperators.RenderTextureOperator)} 16 | とか書く。 17 | 18 | 1.このクラスに対象Assetの型のModifierとしての処理を記述する 19 | DefaultSetting, IsChanged, Modifyの三つのメソッドをoverrideして実装してもらう想定。 20 | 21 | 2.このクラスのデータ型の定義を使ってModifierOperationData(ModifierNodeごとに作成されるjson)のデータを吐き出す 22 | 保存したい設定データに[Serializable]とか[SerializeField]のアノテーションつけるの忘れないように。 23 | 24 | 3.データ型の定義を持ち、Inspector表示時にそのenumを使って内容を表示することができる 25 | インスペクタ部分まだちゃんと作ってないですが、型に応じて作る想定。 26 | 27 | 28 | 定数定義とかについて考えてあること: 29 | ・変更できるパラメータの選別について 30 | オリジナルのAssetのInspector上で扱えるパラメータのみを対象に変更できるようにしようと思ってます。 31 | 例えばRenderTextureであれば、RenderTexture型のAssetのInspectorで表示されるパラメータのみを対象に、 32 | 調整とか変更が出来るようにしようと思っています。 33 | 34 | ・パラメータ名はInspector準拠 35 | 例えばRenderTextureの場合、Inspector上でColor Formatって書いてあるパラメータは、実際のAssetではformatって名前になってます。 36 | 37 | API上:renderTexture.format 38 | Inspector上:Color Format 39 | 40 | で、保存するパラメータ名をAPIとInspectorのどっちに合わせようか悩んだんですが、 41 | 42 | Inspectorで表示されてる変更可能なパラメータ数 < APIで扱える変更可能なパラメータ数 という前提がまあ自明であるので、 43 | より強い制約を作り出しているInspectorに準拠しようと思ってます。 44 | 45 | IsChangedやModifyメソッド内では、その辺を加味してAPIとInspector上の名前の違いを突き合せる根性が必要です。 46 | その代わりInspector上での値とパラメータ名のマッチングが楽です。 47 | 48 | ・閾値とEnumが定義されているパラメータについて 49 | 例えばRenderTextureのwrapModeは、Enum UnityEngine.TextureWrapModeを使っています。 50 | で、すでに定義されているEnumがある場合は、極力そのEnumを使うと、データ化や反映が楽なんで、 51 | この型でもUnityEngine.TextureWrapModeを保持して互換性を大事にしようと思ってます。 52 | 53 | ・閾値はあるんだけどEnumのないパラメータについて 54 | RenderTextureのantiAliasingのように、int値かつ特定の値のみを持ち、 55 | EnumではなくInt32とかを使っていて、 56 | 57 | なおかつInspector上で[None]とか[2 samples]とか 58 | そういう表記になっているパラメータは、この型でEnumを作成して制約をつけています。 59 | 60 | ここで定義したEnumに関しては、データ型としてのRead/Writeはもちろん、Inspector上からも参照する想定です。 61 | 62 | ・Inspector上の設定はあるんだけど実際にコードから変更しようとすると変更できないパラメータについて 63 | ImportSetting作ってる時もあったんですが、 64 | API上は読めて書いてできるように見えるんだけど実際には変更できない(実行時にエラーが出る)パラメータが多々あります。 65 | RenderTextureの場合は、widthとかheight、colorFormat, depthあたりが「実際には変更不可」でした。 66 | 67 | 本物のInspectorからは変更できるんですが、ユーザーが扱えるレベルのMainThreadのコードでは変更不可っぽいです。 68 | Assetの作り直しとかを強制的にやればいけるのかもしれませんが、GUID変わりそう。 69 | 70 | */ 71 | [Serializable] public class RenderTextureOperator : OperatorBase { 72 | // [SerializeField] public Int32 width, height; 73 | 74 | // public enum AntiAliasing : int { 75 | // None = 1, 76 | // _2_Samples = 2, 77 | // _4_Samples = 4, 78 | // _8_Samples = 8 79 | // } 80 | // [SerializeField] public AntiAliasing antiAliasing;// 1, 2, 4, 8. 4type. 81 | 82 | // [SerializeField] public UnityEngine.RenderTextureFormat colorFormat; 83 | 84 | public enum DepthBuffer : int { 85 | NoDepthBuffer = 0, 86 | _16bitDepth = 16, 87 | _24bitDepth = 24 88 | } 89 | // [SerializeField] public DepthBuffer depthBuffer;// 0, 16, 24. 3type. 90 | 91 | [SerializeField] public UnityEngine.TextureWrapMode wrapMode; 92 | 93 | [SerializeField] public UnityEngine.FilterMode filterMode; 94 | 95 | [SerializeField] public int anisoLevel;// limit to 16. 96 | 97 | 98 | 99 | public RenderTextureOperator () {} 100 | 101 | private RenderTextureOperator ( 102 | string operatorType, 103 | // Int32 width, Int32 height, 104 | // AntiAliasing antiAliasing, 105 | // UnityEngine.RenderTextureFormat colorFormat, 106 | // DepthBuffer depthBuffer, 107 | UnityEngine.TextureWrapMode wrapMode, 108 | UnityEngine.FilterMode filterMode, 109 | Int32 anisoLevel 110 | ) { 111 | this.operatorType = operatorType; 112 | 113 | this.wrapMode = wrapMode; 114 | this.filterMode = filterMode; 115 | this.anisoLevel = anisoLevel; 116 | } 117 | 118 | /* 119 | constructor for default data setting. 120 | */ 121 | public override OperatorBase DefaultSetting () { 122 | return new RenderTextureOperator( 123 | "UnityEngine.RenderTexture", 124 | UnityEngine.TextureWrapMode.Clamp, 125 | UnityEngine.FilterMode.Bilinear, 126 | 0 127 | ); 128 | } 129 | 130 | public override bool IsChanged (T asset) { 131 | var renderTex = asset as RenderTexture; 132 | 133 | var changed = false; 134 | 135 | if (renderTex.wrapMode != this.wrapMode) changed = true; 136 | if (renderTex.filterMode != this.filterMode) changed = true; 137 | if (renderTex.anisoLevel != this.anisoLevel) changed = true; 138 | 139 | return changed; 140 | } 141 | 142 | public override void Modify (T asset) { 143 | var renderTex = asset as RenderTexture; 144 | 145 | renderTex.wrapMode = this.wrapMode; 146 | renderTex.filterMode = this.filterMode; 147 | 148 | /* 149 | depth parameter cannot change from code. 150 | and anisoLevel can be change if asset's depth is 0. 151 | */ 152 | if (renderTex.depth == (int)DepthBuffer.NoDepthBuffer) { 153 | renderTex.anisoLevel = this.anisoLevel; 154 | } 155 | } 156 | 157 | public override void DrawInspector (Action changed) { 158 | // wrapMode 159 | var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]); 160 | if (newWrapMode != this.wrapMode) { 161 | this.wrapMode = newWrapMode; 162 | changed(); 163 | } 164 | 165 | // filterMode 166 | var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]); 167 | if (newFilterMode != this.filterMode) { 168 | this.filterMode = newFilterMode; 169 | changed(); 170 | } 171 | 172 | // anisoLevel 173 | using (new GUILayout.HorizontalScope()) { 174 | GUILayout.Label("Aniso Level"); 175 | 176 | var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16); 177 | if (changedVal != this.anisoLevel) { 178 | this.anisoLevel = changedVal; 179 | changed(); 180 | } 181 | } 182 | EditorGUILayout.HelpBox("Aniso Level can be set if target Asset(RenderTexture)'s Depth Buffer is No depth buffer. ", MessageType.Info); 183 | } 184 | } 185 | 186 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/RenderTextureOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d7e7076ff8b842c7923bb19cffbe0b4 3 | timeCreated: 1471668016 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/SceneOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class SceneOperator : OperatorBase { 9 | 10 | public SceneOperator () {} 11 | 12 | private SceneOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new SceneOperator( 23 | "UnityEngine.SceneManagement.Scene" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var scene = asset as SceneAsset; 29 | 30 | var changed = false; 31 | 32 | return changed; 33 | } 34 | 35 | public override void Modify (T asset) { 36 | var scene = asset as SceneAsset; 37 | 38 | } 39 | 40 | public override void DrawInspector (Action changed) { 41 | GUILayout.Label("SceneOperator inspector."); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/SceneOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9d72d9b344ed49b99c8fd858de1c88e 3 | timeCreated: 1472560321 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/ShaderOperator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace AssetBundleGraph.ModifierOperators { 7 | 8 | [Serializable] public class ShaderOperator : OperatorBase { 9 | 10 | public ShaderOperator () {} 11 | 12 | private ShaderOperator ( 13 | string operatorType 14 | ) { 15 | this.operatorType = operatorType; 16 | } 17 | 18 | /* 19 | constructor for default data setting. 20 | */ 21 | public override OperatorBase DefaultSetting () { 22 | return new ShaderOperator( 23 | "UnityEngine.Shader" 24 | ); 25 | } 26 | 27 | public override bool IsChanged (T asset) { 28 | var shader = asset as Shader; 29 | 30 | var changed = false; 31 | 32 | /* 33 | Variables 34 | 35 | maximumLOD Shader LOD level for this shader. 36 | */ 37 | 38 | return changed; 39 | } 40 | 41 | public override void Modify (T asset) { 42 | var shader = asset as Shader; 43 | 44 | } 45 | 46 | public override void DrawInspector (Action changed) { 47 | GUILayout.Label("ShaderOperator inspector."); 48 | } 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/Integrated/ModifierOperators/ShaderOperator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91baa0062664b41af9a934ddeead6376 3 | timeCreated: 1472556290 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/NodeOperation/PrefabricatorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c57ae155d69d4595bf2a993b3da6e38 3 | timeCreated: 1450270418 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83839412ae053441fbeaa0b3cffa4e89 3 | folderAsset: yes 4 | timeCreated: 1471740109 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Utility/FileUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Linq; 6 | using System.IO; 7 | using System.Collections.Generic; 8 | 9 | 10 | namespace AssetBundleGraph { 11 | public class FileUtility { 12 | public static void RemakeDirectory (string localFolderPath) { 13 | if (Directory.Exists(localFolderPath)) Directory.Delete(localFolderPath, true); 14 | Directory.CreateDirectory(localFolderPath); 15 | } 16 | 17 | /** 18 | default is "overwrite same path" by filepath. 19 | */ 20 | public static void CopyFileFromGlobalToLocal (string absoluteSourceFilePath, string localTargetFilePath) { 21 | var parentDirectoryPath = Path.GetDirectoryName(localTargetFilePath); 22 | Directory.CreateDirectory(parentDirectoryPath); 23 | File.Copy(absoluteSourceFilePath, localTargetFilePath, true); 24 | } 25 | 26 | public static void DeleteFileThenDeleteFolderIfEmpty (string localTargetFilePath) { 27 | 28 | File.Delete(localTargetFilePath); 29 | File.Delete(localTargetFilePath + AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION); 30 | var directoryPath = Directory.GetParent(localTargetFilePath).FullName; 31 | var restFiles = FilePathsInFolder(directoryPath); 32 | if (!restFiles.Any()) { 33 | Directory.Delete(directoryPath, true); 34 | File.Delete(directoryPath + AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION); 35 | } 36 | } 37 | 38 | public static List FilePathsOfFile (string filePath) { 39 | var folderPath = Path.GetDirectoryName(filePath); 40 | var results = FilePathsInFolder(folderPath); 41 | return results; 42 | } 43 | 44 | public static List FilePathsInFolder (string localFolderPath) { 45 | var filePaths = new List(); 46 | 47 | if (string.IsNullOrEmpty(localFolderPath)) return filePaths; 48 | if (!Directory.Exists(localFolderPath)) return filePaths; 49 | 50 | GetFilePathsRecursive(localFolderPath, filePaths); 51 | 52 | return filePaths; 53 | } 54 | 55 | private static void GetFilePathsRecursive (string localFolderPath, List filePaths) { 56 | var folders = Directory.GetDirectories(localFolderPath); 57 | 58 | foreach (var folder in folders) { 59 | GetFilePathsRecursive(folder, filePaths); 60 | } 61 | 62 | var files = FilePathsInFolderOnly1Level(localFolderPath); 63 | filePaths.AddRange(files); 64 | } 65 | 66 | public static List FolderPathsInFolder (string path) { 67 | // change platform-depends folder delimiter -> '/' 68 | return ConvertSeparater(Directory.GetDirectories(path).ToList()); 69 | } 70 | 71 | /** 72 | returns file paths which are located in the folder. 73 | 74 | this method is main point for supporting path format of cross platform. 75 | 76 | Usually Unity Editor uses '/' as folder delimter. 77 | 78 | e.g. 79 | Application.dataPath returns 80 | C:/somewhere/projectPath/Assets @ Windows. 81 | or 82 | /somewhere/projectPath/Assets @ Mac, Linux. 83 | 84 | 85 | but "Directory.GetFiles(localFolderPath + "/")" method returns different formatted path by platform. 86 | 87 | @ Windows: 88 | localFolderPath + / + somewhere\folder\file.extention 89 | 90 | @ Mac/Linux: 91 | localFolderPath + / + somewhere/folder/file.extention 92 | 93 | the problem is, "Directory.GetFiles" returns mixed format path of files @ Windows. 94 | this is the point of failure. 95 | 96 | this method replaces folder delimiters to '/'. 97 | */ 98 | public static List FilePathsInFolderOnly1Level (string localFolderPath) { 99 | // change platform-depends folder delimiter -> '/' 100 | var filePaths = ConvertSeparater(Directory.GetFiles(localFolderPath) 101 | .Where(path => !(Path.GetFileName(path).StartsWith(AssetBundleGraphSettings.DOTSTART_HIDDEN_FILE_HEADSTRING))) 102 | .ToList()); 103 | 104 | if (AssetBundleGraphSettings.IGNORE_META) filePaths = filePaths.Where(path => !FileUtility.IsMetaFile(path)).ToList(); 105 | 106 | return filePaths; 107 | } 108 | 109 | public static List ConvertSeparater (List source) { 110 | return source.Select(filePath => filePath.Replace(Path.DirectorySeparatorChar.ToString(), AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR.ToString())).ToList(); 111 | } 112 | 113 | /** 114 | create combination of path. 115 | 116 | delimiter is always '/'. 117 | */ 118 | public static string PathCombine (params string[] paths) { 119 | if (paths.Length < 2) { 120 | throw new ArgumentException("Argument must contain at least 2 strings to combine."); 121 | } 122 | 123 | var combinedPath = _PathCombine(paths[0], paths[1]); 124 | var restPaths = new string[paths.Length-2]; 125 | 126 | Array.Copy(paths, 2, restPaths, 0, restPaths.Length); 127 | foreach (var path in restPaths) combinedPath = _PathCombine(combinedPath, path); 128 | 129 | return combinedPath; 130 | } 131 | 132 | private static string _PathCombine (string head, string tail) { 133 | if (!head.EndsWith(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR.ToString())) head = head + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; 134 | 135 | if (string.IsNullOrEmpty(tail)) return head; 136 | if (tail.StartsWith(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR.ToString())) tail = tail.Substring(1); 137 | 138 | return Path.Combine(head, tail); 139 | } 140 | 141 | public static string GetPathWithProjectPath (string pathUnderProjectFolder) { 142 | var assetPath = Application.dataPath; 143 | var projectPath = Directory.GetParent(assetPath).ToString(); 144 | return FileUtility.PathCombine(projectPath, pathUnderProjectFolder); 145 | } 146 | 147 | public static string GetPathWithAssetsPath (string pathUnderAssetsFolder) { 148 | var assetPath = Application.dataPath; 149 | return FileUtility.PathCombine(assetPath, pathUnderAssetsFolder); 150 | } 151 | 152 | public static string ProjectPathWithSlash () { 153 | var assetPath = Application.dataPath; 154 | return Directory.GetParent(assetPath).ToString() + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; 155 | } 156 | 157 | public static bool IsMetaFile (string filePath) { 158 | if (filePath.EndsWith(AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION)) return true; 159 | return false; 160 | } 161 | 162 | public static bool ContainsHiddenFiles (string filePath) { 163 | var pathComponents = filePath.Split(AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR); 164 | foreach (var path in pathComponents) { 165 | if (path.StartsWith(AssetBundleGraphSettings.DOTSTART_HIDDEN_FILE_HEADSTRING)) return true; 166 | } 167 | return false; 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Utility/FileUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdbb0c839968c408181ebdd3240d96b4 3 | timeCreated: 1450270420 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Utility/TypeUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using UnityEditor; 5 | using UnityEditor.Animations; 6 | using UnityEngine; 7 | using UnityEngine.SceneManagement; 8 | 9 | namespace AssetBundleGraph { 10 | public static class TypeUtility { 11 | public static readonly List KeyTypes = new List{ 12 | // empty 13 | AssetBundleGraphSettings.DEFAULT_FILTER_KEYTYPE, 14 | 15 | // importers 16 | typeof(TextureImporter).ToString(), 17 | typeof(ModelImporter).ToString(), 18 | typeof(AudioImporter).ToString(), 19 | 20 | // others(Assets) 21 | typeof(Animation).ToString(), 22 | typeof(Animator).ToString(), 23 | typeof(AvatarMask).ToString(), 24 | typeof(Cubemap).ToString(), 25 | typeof(Flare).ToString(), 26 | typeof(Font).ToString(), 27 | typeof(GUISkin).ToString(), 28 | // typeof(LightmapParameters).ToString(), 29 | typeof(Material).ToString(), 30 | typeof(PhysicMaterial).ToString(), 31 | typeof(PhysicsMaterial2D).ToString(), 32 | typeof(RenderTexture).ToString(), 33 | // typeof(SceneAsset).ToString(), 34 | typeof(Shader).ToString(), 35 | typeof(Scene).ToString(), 36 | }; 37 | 38 | public static readonly Dictionary AssumeTypeBindingByExtension = new Dictionary{ 39 | // others(Assets) 40 | {".anim", typeof(Animation)}, 41 | {".controller", typeof(Animator)}, 42 | {".mask", typeof(AvatarMask)}, 43 | {".cubemap", typeof(Cubemap)}, 44 | {".flare", typeof(Flare)}, 45 | {".fontsettings", typeof(Font)}, 46 | {".guiskin", typeof(GUISkin)}, 47 | // typeof(LightmapParameters).ToString(), 48 | {".mat", typeof(Material)}, 49 | {".physicMaterial", typeof(PhysicMaterial)}, 50 | {".physicsMaterial2D", typeof(PhysicsMaterial2D)}, 51 | {".renderTexture", typeof(RenderTexture)}, 52 | // typeof(SceneAsset).ToString(), 53 | {".shader", typeof(Shader)}, 54 | {".unity", typeof(Scene)}, 55 | 56 | // {"", typeof(Sprite)}, 57 | }; 58 | 59 | public static readonly List IgnoredExtension = new List{ 60 | string.Empty, 61 | ".manifest", 62 | ".assetbundle", 63 | ".sample", 64 | ".cs", 65 | ".sh", 66 | ".json", 67 | ".js", 68 | }; 69 | 70 | /** 71 | * Get type of asset from give path. 72 | */ 73 | public static Type GetTypeOfAsset (string assetPath) { 74 | if (assetPath.EndsWith(AssetBundleGraphSettings.UNITY_METAFILE_EXTENSION)) return typeof(string); 75 | 76 | var asset = AssetDatabase.LoadMainAssetAtPath(assetPath); 77 | 78 | // If asset is null, this asset is not imported yet, or unsupported type of file 79 | // so we set this to object type. 80 | if (asset == null) { 81 | return typeof(object); 82 | } 83 | return asset.GetType(); 84 | } 85 | 86 | /** 87 | * Get type of asset from give path. 88 | */ 89 | public static Type FindTypeOfAsset (string assetPath) { 90 | // check by asset importer type. 91 | var importer = AssetImporter.GetAtPath(assetPath); 92 | if (importer == null) { 93 | Debug.LogWarning("Failed to assume assetType of asset. The asset will be ignored: " + assetPath); 94 | return typeof(object); 95 | } 96 | 97 | var assumedImporterType = importer.GetType(); 98 | var importerTypeStr = assumedImporterType.ToString(); 99 | 100 | switch (importerTypeStr) { 101 | case "UnityEditor.TextureImporter": 102 | case "UnityEditor.ModelImporter": 103 | case "UnityEditor.AudioImporter": { 104 | return assumedImporterType; 105 | } 106 | } 107 | 108 | // not specific type importer. should determine their type by extension. 109 | var extension = Path.GetExtension(assetPath); 110 | if (AssumeTypeBindingByExtension.ContainsKey(extension)) { 111 | return AssumeTypeBindingByExtension[extension]; 112 | } 113 | 114 | if (IgnoredExtension.Contains(extension)) { 115 | return null; 116 | } 117 | 118 | // unhandled. 119 | Debug.LogWarning("Unknown file type found:" + extension + "\n. Asset:" + assetPath + "\n Assume 'object'."); 120 | return typeof(object); 121 | } 122 | 123 | /** 124 | * ModifierOperator map vs supported type 125 | */ 126 | public static Dictionary SupportedModifierOperatorDefinition = new Dictionary { 127 | {"UnityEngine.Animation", typeof(ModifierOperators.AnimationOperator)}, 128 | {"UnityEngine.Animator", typeof(ModifierOperators.AnimatorOperator)}, 129 | {"UnityEditor.Animations.AvatarMask", typeof(ModifierOperators.AvatarMaskOperator)}, 130 | {"UnityEngine.Cubemap", typeof(ModifierOperators.CubemapOperator)}, 131 | {"UnityEngine.Flare", typeof(ModifierOperators.FlareOperator)}, 132 | {"UnityEngine.Font", typeof(ModifierOperators.FontOperator)}, 133 | {"UnityEngine.GUISkin", typeof(ModifierOperators.GUISkinOperator)}, 134 | // typeof(LightmapParameters).ToString(),// ファイルにならない 135 | {"UnityEngine.Material", typeof(ModifierOperators.MaterialOperator)}, 136 | {"UnityEngine.PhysicMaterial", typeof(ModifierOperators.PhysicMaterialOperator)}, 137 | {"UnityEngine.PhysicsMaterial2D", typeof(ModifierOperators.PhysicsMaterial2DOperator)}, 138 | {"UnityEngine.RenderTexture", typeof(ModifierOperators.RenderTextureOperator)}, 139 | // // typeof(SceneAsset).ToString(),// ファイルにならない 140 | {"UnityEngine.Shader", typeof(ModifierOperators.ShaderOperator)}, 141 | {"UnityEngine.SceneManagement.Scene", typeof(ModifierOperators.SceneOperator)}, 142 | }; 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Editor/System/Utility/TypeUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f741340573f24a4b91fc47588dc7b14 3 | timeCreated: 1461082533 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0f32454ef3b54fd2bc320ab01a7fc49 3 | folderAsset: yes 4 | timeCreated: 1472575975 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61144b0e84ac2454598a5bdb6f8ec937 3 | folderAsset: yes 4 | timeCreated: 1472575975 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated/Editor/MyModifier.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | /* 8 | public class MyModifier : AssetBundleGraph.PrefabricatorBase { 9 | public override void ValidateCanCreatePrefab (string nodeName, string nodeId, string groupKey, List sources, string recommendedPrefabOutputDir, Func Prefabricate) { 10 | // Test and see if Prefab can be created 11 | // use Prefabricate deledate to create prefab. 12 | } 13 | 14 | public override void CreatePrefab (string nodeName, string nodeId, string groupKey, List source, string recommendedPrefabOutputDir, Func Prefabricate) { 15 | // use Prefabricate deledate to create prefab. 16 | } 17 | } 18 | */ 19 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated/Editor/MyModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01131901d90bf41b5a69d6b3802509df 3 | timeCreated: 1472576429 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated/Editor/MyPrefabricator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public class MyPrefabricator : AssetBundleGraph.PrefabricatorBase { 8 | public override void ValidateCanCreatePrefab (string nodeName, string nodeId, string groupKey, List sources, string recommendedPrefabOutputDir, Func Prefabricate) { 9 | // Test and see if Prefab can be created 10 | // use Prefabricate deledate to create prefab. 11 | } 12 | 13 | public override void CreatePrefab (string nodeName, string nodeId, string groupKey, List source, string recommendedPrefabOutputDir, Func Prefabricate) { 14 | // use Prefabricate deledate to create prefab. 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/AssetBundleGraph/Generated/Editor/MyPrefabricator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02d7fed5666394a10a890939d4bb3ae0 3 | timeCreated: 1472575975 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Doc/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/1.png -------------------------------------------------------------------------------- /Doc/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/100.png -------------------------------------------------------------------------------- /Doc/1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/1000.png -------------------------------------------------------------------------------- /Doc/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/2.png -------------------------------------------------------------------------------- /Doc/200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/200.png -------------------------------------------------------------------------------- /Doc/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/3.png -------------------------------------------------------------------------------- /Doc/300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/300.png -------------------------------------------------------------------------------- /Doc/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/4.png -------------------------------------------------------------------------------- /Doc/400-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/400-0.png -------------------------------------------------------------------------------- /Doc/400-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/400-1.png -------------------------------------------------------------------------------- /Doc/400-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/400-2.png -------------------------------------------------------------------------------- /Doc/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/5.png -------------------------------------------------------------------------------- /Doc/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/500.png -------------------------------------------------------------------------------- /Doc/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/6.png -------------------------------------------------------------------------------- /Doc/600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/600.png -------------------------------------------------------------------------------- /Doc/700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/700.png -------------------------------------------------------------------------------- /Doc/800.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/800.png -------------------------------------------------------------------------------- /Doc/900.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/900.png -------------------------------------------------------------------------------- /Doc/Node to Node connectivity.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/Node to Node connectivity.numbers -------------------------------------------------------------------------------- /Doc/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/1.png -------------------------------------------------------------------------------- /Doc/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/2.png -------------------------------------------------------------------------------- /Doc/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/3.png -------------------------------------------------------------------------------- /Doc/images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/4.png -------------------------------------------------------------------------------- /Doc/images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/5.png -------------------------------------------------------------------------------- /Doc/images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/6.png -------------------------------------------------------------------------------- /Doc/images/7_bundlebuilder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_bundlebuilder.png -------------------------------------------------------------------------------- /Doc/images/7_bundlizer_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_bundlizer_0.png -------------------------------------------------------------------------------- /Doc/images/7_bundlizer_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_bundlizer_1.png -------------------------------------------------------------------------------- /Doc/images/7_bundlizer_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_bundlizer_2.png -------------------------------------------------------------------------------- /Doc/images/7_exporter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_exporter.png -------------------------------------------------------------------------------- /Doc/images/7_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_filter.png -------------------------------------------------------------------------------- /Doc/images/7_grouping_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_grouping_0.png -------------------------------------------------------------------------------- /Doc/images/7_grouping_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_grouping_1.png -------------------------------------------------------------------------------- /Doc/images/7_grouping_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_grouping_2.png -------------------------------------------------------------------------------- /Doc/images/7_importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_importer.png -------------------------------------------------------------------------------- /Doc/images/7_loader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_loader.png -------------------------------------------------------------------------------- /Doc/images/7_prefabricator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/7_prefabricator.png -------------------------------------------------------------------------------- /Doc/images/8_0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/8_0.gif -------------------------------------------------------------------------------- /Doc/images/8_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/8_1.png -------------------------------------------------------------------------------- /Doc/images/howto_0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_0.gif -------------------------------------------------------------------------------- /Doc/images/howto_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_1.gif -------------------------------------------------------------------------------- /Doc/images/howto_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_2.gif -------------------------------------------------------------------------------- /Doc/images/howto_3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_3.gif -------------------------------------------------------------------------------- /Doc/images/howto_4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_4.gif -------------------------------------------------------------------------------- /Doc/images/howto_5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_5.gif -------------------------------------------------------------------------------- /Doc/images/howto_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_6.png -------------------------------------------------------------------------------- /Doc/images/howto_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unity-cn/AssetGraph/03ea74a9abd5b98b15bccdfc2b0f42c33c020ec9/Doc/images/howto_7.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AssetGraph 2 | 3 | 中文介绍 4 | http://forum.china.unity3d.com/thread-20959-1-1.html 5 | 6 | AssetGraph is a visual toolset lets you configure and create Unity's AssetBundles. It is intended to create rule-based configuration in visual form to create and manage efficient workflow around AssetBundle generation. 7 | 8 | 9 | ##Usage 10 | ###1.Add Nodes 11 | Right click AssetGraph canvas gives you list of nodes you can create. Select one of them and create nodes. To start, create Loader node to identify which assets should go into AssetBundles. 12 | ![SS](/Doc/1.png) 13 | 14 | ###2.Connect Them 15 | When you create more than two nodes, let's connect them. Simply click the dot on created node, drag and drop to the dot of other node you wish to connect, then you will have link. 16 | 17 | AssetGraph gives you live update preview of asset list that will be passed through the link. By clicking link you will see the full list of assets. 18 | 19 | ![SS](/Doc/2.png) 20 | 21 | ###3.Configure Settings 22 | By selecting a node, you can configure settings for your AssetBundle building rules. I.e. Filter node let you configure filtering rules, Importer node let you configure different importing setting you wish to apply onto assets go through that node. 23 | ![SS](/Doc/3.png) 24 | 25 | ###4.Build It! 26 | By pressing Build button on AssetGraph window, AssetBundles are built respect to rules you created. 27 | Visual editor lets you build AssetBunldes in the way you want to while keeping everything easy, repeatable and scalable. 28 | ![SS](/Doc/4.png) 29 | ![SS](/Doc/5.png) 30 | ![SS](/Doc/6.png) 31 | 32 | ##Why Rule Based? 33 | Because AssetGraph handles AssetBundle build pipeline by rules, programmers can safely build simple workflow with artists or game designers without making them worry about AssetBundle configuration. When they add new assets into project, AssetGraph automatically takes care of them and build necessary AssetBundles by your rule(s). 34 | 35 | 36 | 37 | 38 | ##Nodes tips 39 | There are several types of nodes you can use to construct AssetBundle building pipeline. 40 | 41 | ###Loader 42 | Loader finds and lists assets. You can specify root directory of assets to target. You can also select directory outside /Assets/. 43 | - IN: none 44 | - OUT: list of assets under given root directory 45 | 46 | ![SS](/Doc/1000.png) 47 | 48 | ###Filter 49 | Filter filters list of assets passed by previous node. You can add multiple filtering rules to create multiple filter result. 50 | - IN: list of assets 51 | - OUT: list of assets which matches given filter setting 52 | 53 | ![SS](/Doc/600.png) 54 | 55 | ###Importer 56 | Importer overwrites import settings of assets passed by previous node for this AssetBundle build. (NOTE: original asset configuration remains. ) 57 | - IN: list of assets 58 | - OUT: list of assets with given importer settings applied 59 | 60 | ![SS](/Doc/500.png) 61 | 62 | ###Grouping 63 | Grouping makes a group of resources from given list of assets by configured keyword. 64 | "Group" is very useful approach for building AssetBundle. In keyword configuration, you can use *"*"* as a wildcard. 65 | - IN: list of assets 66 | - OUT: list of group of assets 67 | 68 | ![SS](/Doc/400-0.png) 69 | ![SS](/Doc/400-1.png) 70 | ![SS](/Doc/400-2.png) 71 | 72 | ###Prefabricator 73 | Prefabricator is a node that let you create Prefab in the form you need in your game. You can use Prefabricator by extending AssetGraph.PrefabricatorBase script and make your own Prefab. 74 | - IN: list of group of assets 75 | - OUT: list of group of assets (generated prefabs added to each group) 76 | 77 | ![SS](/Doc/700.png) 78 | 79 | #### Prefabricator code example: 80 | ``` 81 | public class CreateCharaPrefab : AssetGraph.PrefabricatorBase { 82 | public override void In (string groupKey, List source, string recommendedPrefabOutputDir) { 83 | /* 84 | create character's prefab. 85 | 86 | 1.texture & material -> set texture to the material of model. 87 | 2.model -> instantiate, then set material to model. 88 | 3.new prefab -> prefabricate model to new prefab. 89 | 4.delete model instance from hierarchy. 90 | */ 91 | 92 | ~~~ DO SOMETHING ~~~ 93 | 94 | // export prefab data. 95 | PrefabUtility.ReplacePrefab(modelObj, prefabFile); 96 | 97 | } 98 | } 99 | ``` 100 | 101 | full example script is [here](https://github.com/unity3d-jp/AssetGraph/blob/0.7.2/Assets/AssetGraph/Yours/Editor/CreateCharaPrefab.cs#L8). 102 | 103 | 104 | ###Bundlizer 105 | Bundlizer create "bundle" of given group of assets and configure generating AssetBundle's filename. "*" will be replaced to the grouping identifier. 106 | - IN: list of group of assets 107 | - OUT: list of bundles 108 | 109 | ![SS](/Doc/800.png) 110 | 111 | 112 | ###BundleBuilder 113 | BundleBuilder create actual AssetBundle files from given list of bundle configurations. By using Bundlizer and BundleBuilder(s), you can simultaneously create AssetBundles with different AssetBundle configuration (i.e. compressed & uncompressed) 114 | 115 | - IN: list of bundles 116 | - OUT: list of generated AssetBundle files 117 | 118 | ![SS](/Doc/100.png) 119 | 120 | 121 | ###Exporter 122 | Exporter saves given assets into given directory. You can also select directory outside /Assets/. 123 | - IN: list of assets (or AssetBundle files) 124 | 125 | ![SS](/Doc/900.png) 126 | 127 | 128 | #License 129 | 130 | The MIT License (MIT) 131 | Copyright (c) 2016 Unity Technologies 132 | 133 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 134 | 135 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 136 | 137 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 138 | --------------------------------------------------------------------------------