├── MonsterABSystem ├── .gitignore ├── Assets │ ├── BundleResources.meta │ ├── BundleResources │ │ ├── Plane 1.prefab │ │ ├── Plane 1.prefab.meta │ │ ├── Plane 2.prefab │ │ ├── Plane 2.prefab.meta │ │ ├── Plane 3.prefab │ │ ├── Plane 3.prefab.meta │ │ ├── Plane.prefab │ │ └── Plane.prefab.meta │ ├── Editor.meta │ ├── Editor │ │ ├── AssetBundleBuilder.meta │ │ ├── AssetBundleBuilder │ │ │ ├── AssetBundleBuilderWindow.cs │ │ │ ├── AssetBundleBuilderWindow.cs.meta │ │ │ ├── Builder.meta │ │ │ └── Builder │ │ │ │ ├── AssetBundleBuilder_5.cs │ │ │ │ ├── AssetBundleBuilder_5.cs.meta │ │ │ │ ├── AssetRefrenceNode.cs │ │ │ │ ├── AssetRefrenceNode.cs.meta │ │ │ │ ├── BuilderConfig.cs │ │ │ │ ├── BuilderConfig.cs.meta │ │ │ │ ├── Utility.cs │ │ │ │ └── Utility.cs.meta │ │ ├── EditorUtil.cs │ │ └── EditorUtil.cs.meta │ ├── Materials.meta │ ├── Materials │ │ ├── @ESER%{NTIZR063)$N4RCTE.png │ │ ├── @ESER%{NTIZR063)$N4RCTE.png.meta │ │ ├── H3G9X)3O[0I]E2}F}YZN6PU.png │ │ ├── H3G9X)3O[0I]E2}F}YZN6PU.png.meta │ │ ├── New Material 1.mat │ │ ├── New Material 1.mat.meta │ │ ├── New Material 2.mat │ │ ├── New Material 2.mat.meta │ │ ├── New Material.mat │ │ └── New Material.mat.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── LitJson.dll │ │ └── LitJson.dll.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── BaseSystem.meta │ │ ├── BaseSystem │ │ │ ├── CoroutineTask.meta │ │ │ ├── CoroutineTask │ │ │ │ ├── AssetLoadTask.cs │ │ │ │ ├── AssetLoadTask.cs.meta │ │ │ │ ├── BaseCoroutineTask.cs │ │ │ │ ├── BaseCoroutineTask.cs.meta │ │ │ │ ├── ICoroutineResult.cs │ │ │ │ └── ICoroutineResult.cs.meta │ │ │ ├── ResoucesFacade.cs │ │ │ ├── ResoucesFacade.cs.meta │ │ │ ├── ResourceManager.meta │ │ │ └── ResourceManager │ │ │ │ ├── AsyncOperationRequest.cs │ │ │ │ ├── AsyncOperationRequest.cs.meta │ │ │ │ ├── AsyncResourceRequest.cs │ │ │ │ ├── AsyncResourceRequest.cs.meta │ │ │ │ ├── BaseResourceManager.cs │ │ │ │ ├── BaseResourceManager.cs.meta │ │ │ │ ├── Bundle.meta │ │ │ │ ├── Bundle │ │ │ │ ├── AssetBundleConfig.cs │ │ │ │ ├── AssetBundleConfig.cs.meta │ │ │ │ ├── AssetBundleHint.cs │ │ │ │ ├── AssetBundleHint.cs.meta │ │ │ │ ├── AsyncAssetRequest.cs │ │ │ │ ├── AsyncAssetRequest.cs.meta │ │ │ │ ├── AsyncBundleCreateMainRequest.cs │ │ │ │ ├── AsyncBundleCreateMainRequest.cs.meta │ │ │ │ ├── AsyncBundleCreateRequest.cs │ │ │ │ ├── AsyncBundleCreateRequest.cs.meta │ │ │ │ ├── BundleTool.cs │ │ │ │ └── BundleTool.cs.meta │ │ │ │ ├── BundleResourceManager.cs │ │ │ │ ├── BundleResourceManager.cs.meta │ │ │ │ ├── EditorResourceManager.cs │ │ │ │ ├── EditorResourceManager.cs.meta │ │ │ │ ├── Interface.meta │ │ │ │ ├── Interface │ │ │ │ ├── IAsyncResourceRequest.cs │ │ │ │ ├── IAsyncResourceRequest.cs.meta │ │ │ │ ├── IResourceManager.cs │ │ │ │ └── IResourceManager.cs.meta │ │ │ │ ├── ResourceAsyncCallBack.cs │ │ │ │ └── ResourceAsyncCallBack.cs.meta │ │ ├── LoadAsset.cs │ │ └── LoadAsset.cs.meta │ ├── StreamingAssets.meta │ ├── StreamingAssets │ │ ├── New Material.bytes │ │ ├── New Material.bytes.meta │ │ ├── Plane.bytes │ │ └── Plane.bytes.meta │ ├── scene.unity │ └── scene.unity.meta ├── Bundles │ ├── AssetsConfig.bytes │ ├── Bundles │ ├── Bundles.manifest │ ├── new material.bytes │ ├── new material.bytes.manifest │ ├── plane.bytes │ └── plane.bytes.manifest └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityAdsSettings.asset │ └── UnityConnectSettings.asset └── README.md /MonsterABSystem/.gitignore: -------------------------------------------------------------------------------- 1 | /Library/ 2 | /obj/ 3 | /Temp/ 4 | /Assembly-CSharp-Editor.csproj 5 | /Assembly-CSharp.csproj 6 | /MonsterABSystem.sln 7 | /MonsterABSystem.userprefs 8 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff270fe10fe86c24ebac04b6d05b427e 3 | folderAsset: yes 4 | timeCreated: 1506047480 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/BundleResources/Plane 1.prefab -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1a2d2859eac584449d04930f9ed6938 3 | timeCreated: 1506049926 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/BundleResources/Plane 2.prefab -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 857ca7154c1e08d4289c511602da2c51 3 | timeCreated: 1506049926 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/BundleResources/Plane 3.prefab -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane 3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa2ebb2ad0618b740bbf72911ebd0a9f 3 | timeCreated: 1506049926 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/BundleResources/Plane.prefab -------------------------------------------------------------------------------- /MonsterABSystem/Assets/BundleResources/Plane.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e2e000ada7e6d34a815d61e4a485845 3 | timeCreated: 1506049926 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a0c07ee8529ddf4599d5878cd85f697 3 | folderAsset: yes 4 | timeCreated: 1496397686 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b31f3346ef082c048bfa0f16ddc1eb78 3 | folderAsset: yes 4 | timeCreated: 1505212567 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEditor; 7 | using UnityEngine; 8 | 9 | namespace Assets.Editor.AssetBundleBuilder 10 | { 11 | class AssetBundleBuilderWindow : EditorWindow 12 | { 13 | private const string DB_PATH = "Editor/AssetBundleBuilder/AssetBundleDataBase"; 14 | private static AssetBundleBuilderWindow _instance; 15 | [MenuItem("Tools/Show AssetBundle Builder")] 16 | public static void Open() 17 | { 18 | _instance = (AssetBundleBuilderWindow)EditorWindow.GetWindow(typeof(AssetBundleBuilderWindow)); 19 | _instance.Init(); 20 | } 21 | 22 | private void Init() 23 | { 24 | title = "Builder"; 25 | minSize = new Vector2(300f, 400f); 26 | _config = _config ?? new BuilderConfig(); 27 | } 28 | 29 | private BuilderConfig _config; 30 | void OnGUI() 31 | { 32 | if (this._config == null) 33 | Init(); 34 | EditorGUILayout.BeginHorizontal(); 35 | EditorGUILayout.EndHorizontal(); 36 | EditorGUILayout.BeginHorizontal(); 37 | _config.LoadPath= EditorGUILayout.TextField("Load Path", _config.LoadPath); 38 | if (GUILayout.Button("Select")) 39 | { 40 | var path = EditorUtility.OpenFolderPanel("Load", _config.LoadPath, ""); 41 | _config.LoadPath = string.IsNullOrEmpty(path) ? _config.LoadPath : path; 42 | } 43 | EditorGUILayout.EndHorizontal(); 44 | EditorGUILayout.BeginHorizontal(); 45 | _config.ExportPath = EditorGUILayout.TextField("Export Path", _config.ExportPath); 46 | if (GUILayout.Button("Select")) 47 | { 48 | var path = EditorUtility.OpenFolderPanel("Load", _config.ExportPath, ""); 49 | _config.ExportPath = string.IsNullOrEmpty(path) ? _config.ExportPath : path; 50 | } 51 | EditorGUILayout.EndHorizontal(); 52 | 53 | EditorGUILayout.BeginHorizontal(); 54 | EditorGUILayout.LabelField("BuildAssetBundleOptions:"); 55 | if (GUILayout.Button(_config.options.ToString())) 56 | { 57 | ShowTypeNamesMenu( 58 | _config.options.ToString(), optionsList, 59 | (string selectedTypeStr) => 60 | { 61 | _config.options = optionsMap[selectedTypeStr]; 62 | } 63 | ); 64 | } 65 | EditorGUILayout.EndHorizontal(); 66 | 67 | EditorGUILayout.BeginHorizontal(); 68 | EditorGUILayout.LabelField("BuildTarget:"); 69 | if (GUILayout.Button(_config.target.ToString())) 70 | { 71 | ShowTypeNamesMenu( 72 | _config.target.ToString(), targetList, 73 | (string selectedTypeStr) => 74 | { 75 | _config.target = targetMap[selectedTypeStr]; 76 | } 77 | ); 78 | } 79 | EditorGUILayout.EndHorizontal(); 80 | 81 | EditorGUILayout.BeginHorizontal(); 82 | if (GUILayout.Button("Debug")) 83 | { 84 | new AssetBundleBuilder_5().Debug(_config); 85 | } 86 | if (GUILayout.Button("Build")) 87 | { 88 | new AssetBundleBuilder_5().Excute(_config); 89 | } 90 | EditorGUILayout.EndHorizontal(); 91 | } 92 | 93 | private List optionsList = new List() 94 | { 95 | BuildAssetBundleOptions.None.ToString(), 96 | BuildAssetBundleOptions.DeterministicAssetBundle.ToString(), 97 | BuildAssetBundleOptions.IgnoreTypeTreeChanges.ToString(), 98 | BuildAssetBundleOptions.OmitClassVersions.ToString(), 99 | BuildAssetBundleOptions.UncompressedAssetBundle.ToString(), 100 | }; 101 | 102 | private Dictionary optionsMap = new Dictionary() 103 | { 104 | {BuildAssetBundleOptions.None.ToString(),BuildAssetBundleOptions.None}, 105 | {BuildAssetBundleOptions.DeterministicAssetBundle.ToString(),BuildAssetBundleOptions.DeterministicAssetBundle}, 106 | {BuildAssetBundleOptions.IgnoreTypeTreeChanges.ToString(),BuildAssetBundleOptions.IgnoreTypeTreeChanges}, 107 | {BuildAssetBundleOptions.OmitClassVersions.ToString(),BuildAssetBundleOptions.OmitClassVersions}, 108 | {BuildAssetBundleOptions.UncompressedAssetBundle.ToString(),BuildAssetBundleOptions.UncompressedAssetBundle}, 109 | }; 110 | 111 | private List targetList = new List() 112 | { 113 | BuildTarget.StandaloneWindows.ToString(), 114 | BuildTarget.Android.ToString(), 115 | }; 116 | 117 | private Dictionary targetMap = new Dictionary() 118 | { 119 | {BuildTarget.StandaloneWindows.ToString(),BuildTarget.StandaloneWindows}, 120 | {BuildTarget.Android.ToString(),BuildTarget.Android}, 121 | }; 122 | 123 | void ShowTypeNamesMenu(string current, List contents, Action ExistSelected) 124 | { 125 | var menu = new GenericMenu(); 126 | 127 | for (var i = 0; i < contents.Count; i++) 128 | { 129 | var type = contents[i]; 130 | var selected = false; 131 | if (type == current) selected = true; 132 | 133 | menu.AddItem( 134 | new GUIContent(type), 135 | selected, 136 | () => 137 | { 138 | ExistSelected(type); 139 | } 140 | ); 141 | } 142 | menu.ShowAsContext(); 143 | } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4a34a43a5151b74282aa31bbb6379bb 3 | timeCreated: 1505812849 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fb9cf249ed600b47ad74505e41231f5 3 | folderAsset: yes 4 | timeCreated: 1505819254 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/AssetBundleBuilder_5.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using LitJson; 7 | using Monster.BaseSystem.ResourceManager; 8 | using UnityEditor; 9 | using Object = UnityEngine.Object; 10 | 11 | namespace Assets.Editor.AssetBundleBuilder 12 | { 13 | class AssetBundleBuilder_5 14 | { 15 | public void Excute(BuilderConfig config) 16 | { 17 | var rootList = LoadRootAssets(config.LoadPath); 18 | var deptList = LoadDependenceAssets(rootList); 19 | 20 | //Group 21 | var nodeList = Group(rootList, deptList); 22 | 23 | //Convert 24 | var bundleBuildList = ConvertToBundleBulidList(nodeList); 25 | 26 | //WriteInfo 27 | ExplortAssetBundleConfig(nodeList, config.ExportPath); 28 | 29 | //Build 30 | DoBuild(config.ExportPath, bundleBuildList.ToArray(), config.options, config.target); 31 | } 32 | 33 | public void Debug(BuilderConfig config) 34 | { 35 | var rootList = LoadRootAssets(config.LoadPath); 36 | var deptList = LoadDependenceAssets(rootList); 37 | 38 | //Group 39 | var nodeList = Group(rootList, deptList); 40 | 41 | //Convert 42 | var bundleBuildList = ConvertToBundleBulidList(nodeList); 43 | 44 | //WriteInfo 45 | ExplortAssetBundleConfig(nodeList, config.ExportPath); 46 | 47 | EditorUtil.ClearLog(); 48 | 49 | foreach (var bundleBuild in bundleBuildList) 50 | { 51 | StringBuilder sb= new StringBuilder(); 52 | sb.AppendLine(bundleBuild.assetBundleName); 53 | foreach (var path in bundleBuild.assetNames) 54 | { 55 | sb.AppendLine(path); 56 | } 57 | UnityEngine.Debug.Log(sb.ToString()); 58 | } 59 | } 60 | 61 | private List LoadRootAssets(string path) 62 | { 63 | var list = new List(); 64 | Stack floderStack = new Stack(); 65 | floderStack.Push(new DirectoryInfo(Utility.GetFullPath(path))); 66 | while (floderStack.Count > 0) 67 | { 68 | var floder = floderStack.Pop(); 69 | foreach (var directoryInfo in floder.GetDirectories()) 70 | { 71 | floderStack.Push(directoryInfo); 72 | } 73 | 74 | foreach (var fileInfo in floder.GetFiles()) 75 | { 76 | if (Utility.IsLoadingAsset(fileInfo.Extension)) 77 | { 78 | list.Add(Utility.GetRelativeAssetsPath(fileInfo.FullName)); 79 | } 80 | } 81 | } 82 | return list; 83 | } 84 | 85 | private List LoadDependenceAssets(List rootList) 86 | { 87 | var rootPathSet = new HashSet(); 88 | var listPathSet = new HashSet(); 89 | 90 | foreach (var path in rootList) 91 | { 92 | rootPathSet.Add(path); 93 | } 94 | 95 | var rootObjectList = new List(); 96 | 97 | foreach (var path in rootList) 98 | { 99 | rootObjectList.Add(AssetDatabase.LoadAssetAtPath(path, typeof (Object))); 100 | } 101 | foreach (var depObject in EditorUtility.CollectDependencies(rootObjectList.ToArray())) 102 | { 103 | var depPath = AssetDatabase.GetAssetPath(depObject); 104 | if (!listPathSet.Contains(depPath) && !rootPathSet.Contains(depPath)) 105 | { 106 | if (Utility.IsLoadingAsset(Utility.GetExtension(depPath))) 107 | listPathSet.Add(depPath); 108 | } 109 | } 110 | return listPathSet.ToList(); 111 | } 112 | 113 | private List Group(List rootList, List depList) 114 | { 115 | //准备 116 | var allPathSet = new HashSet(); 117 | foreach (var path in rootList) 118 | { 119 | allPathSet.Add(path); 120 | } 121 | foreach (var path in depList) 122 | { 123 | allPathSet.Add(path); 124 | } 125 | 126 | //构造依赖关系图 127 | var map = new Dictionary(); 128 | foreach (var path in allPathSet) 129 | { 130 | map[path] = new AssetRefrenceNode() {AssetPath = path}; 131 | } 132 | foreach (var pair in map) 133 | { 134 | var path = pair.Key; 135 | var curNode = pair.Value; 136 | var nodeObj = AssetDatabase.LoadAssetAtPath(path, typeof (Object)); 137 | var depObjs = EditorUtility.CollectDependencies(new Object[] {nodeObj}); 138 | 139 | foreach (var depObj in depObjs) 140 | { 141 | var depPath = AssetDatabase.GetAssetPath(depObj); 142 | if (map.ContainsKey(depPath) && path != depPath) 143 | { 144 | curNode.depence.Add(depPath); 145 | map[depPath].depenceOnMe.Add(path); 146 | } 147 | } 148 | } 149 | 150 | //合并依赖 清除同层之间的依赖 把同层之间被依赖的结点下移 两层结构 a->b,a->c,b->c 下移c 为:a->b->c 三层结构 151 | /* 152 | * a a 153 | * / \ / 154 | * b -> c ==> b 155 | * / 156 | * c 157 | */ 158 | var rootQueue = new Queue(); 159 | List toRemove = new List(); 160 | HashSet depSet = new HashSet(); 161 | foreach (var path in rootList) 162 | { 163 | rootQueue.Enqueue(path); 164 | } 165 | while (rootQueue.Count > 0) 166 | { 167 | depSet.Clear(); 168 | toRemove.Clear(); 169 | var path = rootQueue.Dequeue(); 170 | var node = map[path]; 171 | foreach (var depPath in node.depence) 172 | { 173 | depSet.Add(depPath); 174 | } 175 | foreach (var depPath in node.depence) 176 | { 177 | var depNode = map[depPath]; 178 | foreach (var onMepath in depNode.depenceOnMe) 179 | { 180 | if (depSet.Contains(onMepath)) 181 | toRemove.Add(depPath); 182 | } 183 | } 184 | foreach (var depPath in toRemove) 185 | { 186 | node.depence.Remove(depPath); 187 | var depNode = map[depPath]; 188 | depNode.depenceOnMe.Remove(path); 189 | } 190 | foreach (var depPath in node.depence) 191 | { 192 | if (!rootQueue.Contains(depPath)) 193 | rootQueue.Enqueue(depPath); 194 | } 195 | } 196 | 197 | //打组 向上合并, a->b->c 198 | /* 199 | * a e (a,b) (e,f ) --> d 200 | * \ / / | \ _-^ 201 | * root: b f ==> c h L_____-` ==> group: (a,b,c,h) -> (d) <- (e,f) 202 | * / | \ / 203 | * c h d 204 | */ 205 | HashSet hasSearchSet = new HashSet(); 206 | var list = new List(); 207 | foreach (var path in rootList) 208 | { 209 | rootQueue.Enqueue(path); 210 | } 211 | while (rootQueue.Count > 0) 212 | { 213 | var nodePath = rootQueue.Dequeue(); 214 | var node = map[nodePath]; 215 | hasSearchSet.Add(nodePath); 216 | var depQueue = new Queue(node.depence); 217 | while (depQueue.Count > 0) 218 | { 219 | var depNodePath = depQueue.Dequeue(); 220 | var depNode = map[depNodePath]; 221 | if (depNode.depenceOnMe.Count == 1) 222 | { 223 | node.depence.Remove(depNodePath); 224 | map.Remove(depNodePath); 225 | node.incluedDepReference.Add(depNodePath); 226 | foreach (var dep2Path in depNode.depence) 227 | { 228 | node.depence.Add(dep2Path); 229 | depQueue.Enqueue(dep2Path); 230 | var dep2Node = map[dep2Path]; 231 | dep2Node.depenceOnMe.Remove(depNodePath); 232 | dep2Node.depenceOnMe.Add(nodePath); 233 | } 234 | } 235 | else if (depNode.depenceOnMe.Count > 1) 236 | { 237 | if (!rootQueue.Contains(depNodePath) && !hasSearchSet.Contains(depNodePath)) 238 | rootQueue.Enqueue(depNodePath); 239 | } 240 | } 241 | list.Add(node); 242 | } 243 | 244 | return list; 245 | } 246 | 247 | private AssetBundleBuild[] ConvertToBundleBulidList(List nodeList) 248 | { 249 | var list = new List(); 250 | foreach (var node in nodeList) 251 | { 252 | var path = node.AssetPath; 253 | var name = Utility.GetBundleNames(path); 254 | List assetNames = node.incluedDepReference; 255 | assetNames.Add(path); 256 | list.Add(new AssetBundleBuild() { assetNames = assetNames.ToArray(), assetBundleName = name }); 257 | } 258 | return list.ToArray(); 259 | } 260 | 261 | private void DoBuild(string ouputPath, AssetBundleBuild[] builds, BuildAssetBundleOptions assetBundleOptions, BuildTarget targetPlatform) 262 | { 263 | if (!Directory.Exists(ouputPath)) 264 | { 265 | Directory.CreateDirectory(ouputPath); 266 | } 267 | //Directory.CreateDirectory(ouputPath); 268 | 269 | BuildPipeline.BuildAssetBundles(ouputPath, builds, assetBundleOptions, targetPlatform); 270 | } 271 | 272 | private void ExplortAssetBundleConfig(List list, string exportPath) 273 | { 274 | Dictionary map = new Dictionary(); 275 | foreach (var assetRefrenceNode in list) 276 | { 277 | var bundleNode = new AssetBundleInfoNode(); 278 | var name = Utility.GetFileNameWithOutExtension(assetRefrenceNode.AssetPath); 279 | bundleNode.assetName = name; 280 | foreach (var depPath in assetRefrenceNode.depence) 281 | { 282 | var depName = Utility.GetFileNameWithOutExtension(depPath); 283 | bundleNode.depenceList.Add(depName); 284 | } 285 | map.Add(name, bundleNode); 286 | } 287 | 288 | var json = JsonMapper.ToJson(map); 289 | var configPath = exportPath + "/" + Monster.BaseSystem.ResourceManager.BundleConfig.CONFIG_FILE_NAME; 290 | if (File.Exists(configPath)) 291 | { 292 | File.Delete(configPath); 293 | } 294 | using (var writer = File.CreateText(configPath)) 295 | { 296 | writer.Write(json); 297 | } 298 | } 299 | } 300 | } 301 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/AssetBundleBuilder_5.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3b68ef59ace4164f95c346f4e89ae7c 3 | timeCreated: 1505212567 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/AssetRefrenceNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Assets.Editor.AssetBundleBuilder 7 | { 8 | class AssetRefrenceNode 9 | { 10 | public string AssetPath { get; set; } 11 | public string MainAssetName { get; set; } 12 | 13 | public List depenceOnMe = new List(); 14 | public List depence = new List(); 15 | 16 | public List incluedDepReference = new List(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/AssetRefrenceNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c86ac85e8f2d6904390d4f4a89794768 3 | timeCreated: 1505212567 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/BuilderConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEditor; 6 | using UnityEngine; 7 | 8 | namespace Assets.Editor.AssetBundleBuilder 9 | { 10 | public class BuilderConfig 11 | { 12 | public string LoadPath = Application.dataPath + "/BundleResources"; 13 | public string ExportPath = Application.dataPath.Replace("Assets", "") + "Bundles"; 14 | 15 | public BuildAssetBundleOptions options = BuildAssetBundleOptions.None; 16 | public BuildTarget target = BuildTarget.StandaloneWindows; 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/BuilderConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71655ee395c6cad418ec82f0560dc86e 3 | timeCreated: 1505814571 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/Utility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using Monster.BaseSystem.ResourceManager; 5 | using UnityEngine; 6 | 7 | namespace Assets.Editor.AssetBundleBuilder 8 | { 9 | class Utility 10 | { 11 | private static readonly List IgnoredAssetTypeExtension = new List{ 12 | string.Empty, 13 | ".manifest", 14 | ".meta", 15 | ".assetbundle", 16 | ".sample", 17 | ".unitypackage", 18 | ".cs", 19 | ".sh", 20 | ".js", 21 | ".zip", 22 | ".tar", 23 | ".tgz", 24 | #if UNITY_5_6 || UNITY_5_6_OR_NEWER 25 | #else 26 | ".m4v", 27 | #endif 28 | }; 29 | 30 | public static bool IsLoadingAsset(string fileExtension) 31 | { 32 | return !IgnoredAssetTypeExtension.Contains(fileExtension); 33 | } 34 | 35 | public static string GetRelativeAssetsPath(string path) 36 | { 37 | return "Assets" + Path.GetFullPath(path).Replace(Path.GetFullPath(Application.dataPath), "").Replace('\\', '/'); 38 | } 39 | 40 | public static string GetBundleNames(string path) 41 | { 42 | return Path.GetFileNameWithoutExtension(path) + Monster.BaseSystem.ResourceManager.BundleConfig.FILE_EXTENSION; 43 | } 44 | 45 | public static string GetFileNameWithOutExtension(string path) 46 | { 47 | return Path.GetFileNameWithoutExtension(path); 48 | } 49 | 50 | public static string GetExtension(string path) 51 | { 52 | return Path.GetExtension(path); 53 | } 54 | 55 | public static string GetFullPath(string path) 56 | { 57 | return Path.GetFullPath(path); 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/AssetBundleBuilder/Builder/Utility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 343d3c9579b6e294bad49a70980ff2f0 3 | timeCreated: 1505212567 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/EditorUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace Assets.Editor 8 | { 9 | public static class EditorUtil 10 | { 11 | public static void ClearLog() 12 | { 13 | var assembly = System.Reflection.Assembly.GetAssembly(typeof(UnityEditor.ActiveEditorTracker)); 14 | var type = assembly.GetType("UnityEditorInternal.LogEntries"); 15 | var method = type.GetMethod("Clear"); 16 | method.Invoke(new object(), null); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Editor/EditorUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f80c8c0a2e8228744a34a6f30def302e 3 | timeCreated: 1505816807 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae4f4d30f2deabf4288917424de757ff 3 | folderAsset: yes 4 | timeCreated: 1506049793 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/@ESER%{NTIZR063)$N4RCTE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Materials/@ESER%{NTIZR063)$N4RCTE.png -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/@ESER%{NTIZR063)$N4RCTE.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e7515bf47ef3d641bbbf721fbdfc985 3 | timeCreated: 1506499064 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 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: 1 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/H3G9X)3O[0I]E2}F}YZN6PU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Materials/H3G9X)3O[0I]E2}F}YZN6PU.png -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/H3G9X)3O[0I]E2}F}YZN6PU.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72ac7430f0ed70d41b4a423491f0e73a 3 | timeCreated: 1506502025 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 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: 1 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: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material 1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Materials/New Material 1.mat -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material 1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e7b0484c35f42749a7324b094b72a95 3 | timeCreated: 1506501164 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material 2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Materials/New Material 2.mat -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material 2.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bd90c550f7ef2f4fa52545197ccdc06 3 | timeCreated: 1506501164 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Materials/New Material.mat -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Materials/New Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b09a60cb5880673408677a217a42c5a2 3 | timeCreated: 1506047490 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8cb3380f07870e48928590a18f2f36f 3 | folderAsset: yes 4 | timeCreated: 1505706858 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Plugins/LitJson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/Plugins/LitJson.dll -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Plugins/LitJson.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d9ef57f3220a7641b680ea0607a2585 3 | timeCreated: 1505298199 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ef02a30403f76848a8a98e911ec60d3 3 | folderAsset: yes 4 | timeCreated: 1496330170 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91eee58f6c3a2de44aff2eadcb347381 3 | folderAsset: yes 4 | timeCreated: 1496330184 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80aacd5d65186004ab398d13209694e2 3 | folderAsset: yes 4 | timeCreated: 1500350334 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/AssetLoadTask.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using LitJson; 6 | using Monster.BaseSystem.ResourceManager; 7 | using UnityEngine; 8 | 9 | namespace Monster.BaseSystem.CoroutineTask 10 | { 11 | public class AssetLoadTask: BaseCoroutineTask 12 | { 13 | public override IEnumerator Run() 14 | { 15 | Init(); 16 | yield return 1; 17 | DownLoadBundles(); 18 | this.Progress = 1; 19 | this.IsCompleted = true; 20 | } 21 | 22 | public override void Dispose() 23 | { 24 | } 25 | #region self funcs 26 | 27 | private void Init() 28 | { 29 | this.Progress = 0f; 30 | this.Description = "加载AssetBundles"; 31 | } 32 | 33 | private void DownLoadBundles() 34 | { 35 | var targetPath = Application.streamingAssetsPath; 36 | var map = FindAllBundleNames(); 37 | AssetBundleConfig.map = map; 38 | foreach (var name in map.Keys) 39 | { 40 | var bundleName = BundleTool.GetBundleFileName(name); 41 | File.Copy(BundleConfig.BUNDLE_REMOTE_PATH + "/" + bundleName, targetPath + "/" + bundleName, true); 42 | } 43 | } 44 | 45 | private Dictionary FindAllBundleNames() 46 | { 47 | #if !UNITY_EDITOR 48 | return new Dictionary(); 49 | 50 | #endif 51 | var reader = new StreamReader(File.OpenRead(BundleConfig.BUNDLE_REMOTE_PATH + "/" + BundleConfig.CONFIG_FILE_NAME)); 52 | var config = reader.ReadToEnd(); 53 | reader.Dispose(); 54 | var map = JsonMapper.ToObject>(config); 55 | return map; 56 | } 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/AssetLoadTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87890958f2f36cc46a6aae04a11e485c 3 | timeCreated: 1505203224 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/BaseCoroutineTask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Threading; 4 | 5 | namespace Monster.BaseSystem.CoroutineTask 6 | { 7 | public abstract class BaseCoroutineTask : ICoroutineResult, IDisposable 8 | { 9 | /// 10 | /// 进度 11 | /// 12 | public virtual float Progress { get; protected set; } 13 | /// 14 | /// 描述 15 | /// 16 | public virtual string Description { get; protected set; } 17 | 18 | public abstract IEnumerator Run(); 19 | public abstract void Dispose(); 20 | public virtual bool IsCompleted { get; protected set; } 21 | public virtual object AsyncState { get; protected set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/BaseCoroutineTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ada48c7047126c6478683a4af6786308 3 | timeCreated: 1500350334 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/ICoroutineResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace Monster.BaseSystem.CoroutineTask 4 | { 5 | interface ICoroutineResult 6 | { 7 | /// 8 | /// 指示异步操作是否已完成 9 | /// 10 | bool IsCompleted { get; } 11 | /// 12 | /// 获取一个值, 13 | /// 14 | //IEnumerator CoroutineEnumerator { get; } 15 | /// 16 | /// 用户定义的对象 17 | /// 18 | object AsyncState { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/CoroutineTask/ICoroutineResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d6657a5a8ba9542b24773ee9f44388 3 | timeCreated: 1505203224 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResoucesFacade.cs: -------------------------------------------------------------------------------- 1 | #define BUNDLE_MODEL 2 | using Monster.BaseSystem.ResourceManager; 3 | 4 | namespace Monster.BaseSystem 5 | { 6 | public class ResourcesFacade 7 | { 8 | private static IResourceManager mInstance; 9 | 10 | public static IResourceManager Instance 11 | { 12 | get 13 | { 14 | if (mInstance == null) 15 | { 16 | mInstance = 17 | #if !BUNDLE_MODEL 18 | new EditorResourceManager(); 19 | #else 20 | new BundleResourceManager(); 21 | #endif 22 | } 23 | return mInstance; 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResoucesFacade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e116536502ab2147b8bc396a01c6298 3 | timeCreated: 1500283880 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 985a2313631179044b4d65d22b826700 3 | folderAsset: yes 4 | timeCreated: 1505916202 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/AsyncOperationRequest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Monster.BaseSystem.ResourceManager 4 | { 5 | public class AsyncOperationRequest: IAsyncResourceRequest 6 | { 7 | public string id { get; set; } 8 | public bool isDone { 9 | get { return operation.isDone; } 10 | } 11 | 12 | public object state; 13 | public AsyncOperation operation; 14 | 15 | public AsyncOperationRequest(AsyncOperation operation) 16 | { 17 | this.operation = operation; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/AsyncOperationRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bcd0ea88898e7846af053d4706b9b5c 3 | timeCreated: 1505916203 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/AsyncResourceRequest.cs: -------------------------------------------------------------------------------- 1 |  2 | using UnityEngine; 3 | 4 | namespace Monster.BaseSystem.ResourceManager 5 | { 6 | class AsyncResourceRequest : IAsyncResourceRequest 7 | { 8 | public string id { get; set; } 9 | public bool isDone { get; set; } 10 | 11 | public Object asset; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/AsyncResourceRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c52d2f23d3ac11d4181880125f0ca6aa 3 | timeCreated: 1505993740 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/BaseResourceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | 6 | namespace Monster.BaseSystem.ResourceManager 7 | { 8 | public abstract class BaseResourceManager:IResourceManager 9 | { 10 | private List _doneARList; 11 | private Dictionary _asyncCallBacks; 12 | 13 | #region Interface 14 | public virtual void Init(object data) 15 | { 16 | _doneARList = new List(); 17 | _asyncCallBacks = new Dictionary(); 18 | } 19 | 20 | GameObject IResourceManager.LoadPrefab(string path) 21 | { 22 | return LoadPrefab(path); 23 | } 24 | 25 | public Object Load(string path) 26 | { 27 | return DoLoad(path, typeof (Object), false); 28 | } 29 | 30 | public GameObject LoadPrefab(string path) 31 | { 32 | return DoLoad(path, typeof(GameObject), true) as GameObject; 33 | } 34 | 35 | public Object Load(string path, Type systemTypeInstance) 36 | { 37 | return DoLoad(path, systemTypeInstance, false) as Object; 38 | } 39 | 40 | public T Load(string path) where T : Object 41 | { 42 | return DoLoad(path); 43 | } 44 | 45 | public void LoadAsync(string path, ResourceAsyncCallBack callBack) 46 | { 47 | DoLoadAsync(path, typeof(Object), callBack); 48 | } 49 | 50 | public void LoadAsync(string path, Type systemTypeInstance, ResourceAsyncCallBack callBack) 51 | { 52 | DoLoadAsync(path, systemTypeInstance, callBack); 53 | } 54 | public void LoadAsync(string path, ResourceAsyncCallBack callBack) where T : Object 55 | { 56 | DoLoadAsync(path, callBack); 57 | } 58 | 59 | public void UnLoadAsset(UnityEngine.Object assetToUnload) 60 | { 61 | DoUnLoadAsset(assetToUnload); 62 | } 63 | 64 | public IAsyncResourceRequest UnLoadUnusedAssets() 65 | { 66 | return new AsyncOperationRequest(Resources.UnloadUnusedAssets()); 67 | } 68 | 69 | public void Trik() 70 | { 71 | DoTrik(); 72 | } 73 | #endregion 74 | 75 | #region self funcs 76 | 77 | protected virtual void DoTrik() 78 | { 79 | _doneARList.Clear(); 80 | var itor = _asyncCallBacks.GetEnumerator(); 81 | while (itor.MoveNext()) 82 | { 83 | var ar = itor.Current.Key; 84 | if (ar.isDone) 85 | { 86 | _doneARList.Add(ar); 87 | } 88 | } 89 | 90 | for (int i = 0, count = _doneARList.Count; i < count; i++) 91 | { 92 | var ar = _doneARList[i]; 93 | var callback = _asyncCallBacks[ar]; 94 | _asyncCallBacks.Remove(ar); 95 | if (callback != null) 96 | { 97 | callback.Invoke(ar); 98 | } 99 | } 100 | } 101 | #endregion 102 | protected void AddAsyncCallback(IAsyncResourceRequest resourceRequest, ResourceAsyncCallBack callback) 103 | { 104 | _asyncCallBacks.Add(resourceRequest, callback); 105 | } 106 | 107 | protected abstract Object DoLoad(string path, Type type, bool instantiate); 108 | protected abstract void DoLoadAsync(string path, Type type, ResourceAsyncCallBack callBack); 109 | 110 | 111 | protected abstract T DoLoad(string path) where T : Object; 112 | protected abstract void DoLoadAsync(string path, ResourceAsyncCallBack callBack) where T : Object; 113 | 114 | protected abstract void DoUnLoadAsset(Object assetToUnload); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/BaseResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fb46fa17011f64439559ca6529eafad 3 | timeCreated: 1505924759 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37fa0c4eac72455488c8ff24ddbb6f13 3 | folderAsset: yes 4 | timeCreated: 1505971793 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AssetBundleConfig.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Collections.Generic; 3 | 4 | namespace Monster.BaseSystem.ResourceManager 5 | { 6 | public static class AssetBundleConfig 7 | { 8 | public static Dictionary map; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AssetBundleConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 462148e2125daf143b9d8f0f67e8d697 3 | timeCreated: 1505284472 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AssetBundleHint.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace Monster.BaseSystem.ResourceManager 6 | { 7 | class AssetBundleHint 8 | { 9 | public AssetBundle bundle; 10 | public string assetName; 11 | public int refCount; 12 | public string bundlePath; 13 | public UnityEngine.Object mainAsset; 14 | public List dependenceList = new List(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AssetBundleHint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85743a65b7acc1d44bee18571470da30 3 | timeCreated: 1505925971 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncAssetRequest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Monster.BaseSystem.ResourceManager 4 | { 5 | class AsyncAssetRequest: IAsyncResourceRequest 6 | { 7 | public string id { get; set; } 8 | public bool isDone { get { return request.isDone; } } 9 | 10 | public AssetBundleRequest request; 11 | 12 | public AssetBundleHint hint; 13 | 14 | public ResourceAsyncCallBack callback; 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncAssetRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3fc7be56bbe0a048ae079291fdfee80 3 | timeCreated: 1505916203 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncBundleCreateMainRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Monster.BaseSystem.ResourceManager 7 | { 8 | class AsyncBundleCreateMainRequest : IAsyncResourceRequest 9 | { 10 | public string id { get; private set; } 11 | public bool isDone { 12 | get { return mainRequest.isDone; } 13 | } 14 | 15 | public AsyncBundleCreateRequest mainRequest; 16 | 17 | public ResourceAsyncCallBack callback; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncBundleCreateMainRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72d142721734cb04994b2eb62b587f46 3 | timeCreated: 1505993740 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncBundleCreateRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace Monster.BaseSystem.ResourceManager 5 | { 6 | class AsyncBundleCreateRequest: IAsyncResourceRequest 7 | { 8 | public string id { get; set; } 9 | 10 | public bool isDone 11 | { 12 | get 13 | { 14 | for (int i = 0,count = dependenceRequestList.Count; i dependenceRequestList = new List(); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/AsyncBundleCreateRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db300b5616bbb1344b3c27c57902e244 3 | timeCreated: 1505916203 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/BundleTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using SimpleJson; 5 | using UnityEngine; 6 | 7 | namespace Monster.BaseSystem.ResourceManager 8 | { 9 | public static class BundleTool 10 | { 11 | public static string GetAssetName(string path) 12 | { 13 | int index = path.LastIndexOf('/'); 14 | return index < 0 ? path : path.Substring(index + 1); 15 | } 16 | 17 | public static string GetBundleFileName(string assetName) 18 | { 19 | return assetName + BundleConfig.FILE_EXTENSION; 20 | } 21 | 22 | public static string GetBundleFilePath(string assetName) 23 | { 24 | return BundleConfig.LOCALE_BUNDLE_FLODER_PATH + "/" + GetBundleFileName(assetName); 25 | } 26 | } 27 | 28 | public static class BundleConfig 29 | { 30 | public const string CONFIG_FILE_NAME = "AssetsConfig" + FILE_EXTENSION; 31 | 32 | public const string FILE_EXTENSION = ".bytes"; 33 | 34 | public static string BUNDLE_REMOTE_PATH = Application.dataPath.Replace("Assets", "") + "Bundles"; 35 | 36 | public static string LOCALE_BUNDLE_FLODER_PATH = Application.streamingAssetsPath; 37 | 38 | } 39 | 40 | public class AssetBundleInfoNode 41 | { 42 | public List depenceList = new List(); 43 | public string assetName; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Bundle/BundleTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bbbb021a2d233848a8558a5a003a413 3 | timeCreated: 1505290128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/BundleResourceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEditor; 5 | using UnityEngine; 6 | using Object = UnityEngine.Object; 7 | 8 | namespace Monster.BaseSystem.ResourceManager 9 | { 10 | public class BundleResourceManager : BaseResourceManager 11 | { 12 | public override void Init(object data) 13 | { 14 | base.Init(data); 15 | HintInit(); 16 | } 17 | 18 | protected override Object DoLoad(string path, Type type, bool instantiate) 19 | { 20 | AssetBundleHint hint = HintGet(path); 21 | if (hint != null) 22 | { 23 | return HintLoadMainAsset(hint, instantiate); 24 | } 25 | else 26 | { 27 | Debug.LogError("没有Asset资源"); 28 | return null; 29 | } 30 | } 31 | 32 | protected override T DoLoad(string path) 33 | { 34 | return DoLoad(path, typeof(T), false) as T; 35 | } 36 | 37 | protected override void DoLoadAsync(string path, Type type, ResourceAsyncCallBack callBack) 38 | { 39 | DoLoadAsync(path, callBack); 40 | } 41 | 42 | protected void DoLoadAsync(string path, ResourceAsyncCallBack callback) 43 | { 44 | AssetBundleHint hint = HintGet(path); 45 | if (hint != null) 46 | { 47 | HintLoadMainAssetAsync(hint, callback); 48 | } 49 | else 50 | { 51 | Debug.LogError("没有Asset资源"); 52 | callback(new AsyncResourceRequest()); 53 | } 54 | 55 | } 56 | 57 | protected override void DoLoadAsync(string path, ResourceAsyncCallBack callBack) 58 | { 59 | DoLoadAsync(path, callBack); 60 | } 61 | 62 | protected override void DoUnLoadAsset(Object assetToUnload) 63 | { 64 | AssetBundleHint hint; 65 | int assetInstacneId = assetToUnload.GetInstanceID(); 66 | if (loadedAssetHintMap.TryGetValue(assetInstacneId, out hint)) 67 | { 68 | if (assetInstacneId != hint.mainAsset.GetInstanceID()) 69 | { 70 | Object.Destroy(assetToUnload); 71 | } 72 | HintReduceRefCount(hint); 73 | loadedAssetHintMap.Remove(assetInstacneId); 74 | } 75 | else 76 | { 77 | Debug.LogError("Asset Not Loaded From Facade:", assetToUnload); 78 | //Object.Destroy(assetToUnload); 79 | } 80 | } 81 | 82 | #if UNITY_EDITOR 83 | 84 | protected override void DoTrik() 85 | { 86 | base.DoTrik(); 87 | 88 | DebugLog(); 89 | } 90 | 91 | private void DebugLog() 92 | { 93 | var sb = new StringBuilder(); 94 | var bundleList = new List(); 95 | var assetList = new List(); 96 | var objList = new List(); 97 | foreach (var hint in hintMap.Values) 98 | { 99 | if (hint.bundle != null) 100 | { 101 | bundleList.Add(hint); 102 | } 103 | 104 | if (hint.mainAsset != null) 105 | { 106 | assetList.Add(hint); 107 | } 108 | } 109 | sb.AppendLine(string.Format("BundleResourceInfo bundleCount:{0} assetCount:{1} instantiateCOunt:{2}", bundleList.Count, assetList.Count, loadedAssetHintMap.Count)); 110 | sb.AppendLine("\nHintHasBunlde:"); 111 | foreach (var hint in bundleList) 112 | { 113 | sb.AppendLine(String.Format("bundlename:{0} \trefCount:{1}", hint.assetName, hint.refCount)); 114 | } 115 | sb.AppendLine("\nHintHasAsset:"); 116 | foreach (var hint in assetList) 117 | { 118 | sb.AppendLine(String.Format("bundlename:{0} \trefCount:{1}", hint.assetName, hint.refCount)); 119 | } 120 | 121 | Debug.Log(sb); 122 | } 123 | #endif 124 | #region Reference Countor 125 | 126 | private Dictionary hintMap; 127 | private Dictionary loadedAssetHintMap; 128 | 129 | private void HintInit() 130 | { 131 | hintMap = new Dictionary(); 132 | loadedAssetHintMap= new Dictionary(); 133 | foreach (var pair in AssetBundleConfig.map) 134 | { 135 | var name = pair.Key; 136 | var node = pair.Value; 137 | hintMap[name] = new AssetBundleHint() 138 | { 139 | bundlePath = BundleTool.GetBundleFilePath(node.assetName), 140 | assetName = node.assetName 141 | }; 142 | } 143 | 144 | foreach (var pair in AssetBundleConfig.map) 145 | { 146 | var name = pair.Key; 147 | var node = pair.Value; 148 | var hint = hintMap[name]; 149 | foreach (var depName in node.depenceList) 150 | { 151 | hint.dependenceList.Add(hintMap[depName]); 152 | } 153 | } 154 | } 155 | private AssetBundleHint HintGet(string path) 156 | { 157 | var name = BundleTool.GetAssetName(path); 158 | AssetBundleHint hint; 159 | hintMap.TryGetValue(name, out hint); 160 | return hint; 161 | } 162 | private Object HintLoadMainAsset(AssetBundleHint hint, bool instantiate = false) 163 | { 164 | if (hint.bundle == null) 165 | { 166 | HintLoadAssetBundle(hint); 167 | } 168 | if (hint.mainAsset == null) 169 | { 170 | hint.mainAsset = hint.bundle.LoadAsset(hint.assetName); 171 | } 172 | HintIncreaseRefCount(hint); 173 | var asset = instantiate ? Object.Instantiate(hint.mainAsset) : hint.mainAsset; 174 | loadedAssetHintMap.Add(asset.GetInstanceID(), hint); 175 | return asset; 176 | } 177 | private void HintLoadAssetBundle(AssetBundleHint hint) 178 | { 179 | foreach (var depHint in hint.dependenceList) 180 | { 181 | HintLoadAssetBundle(depHint); 182 | } 183 | hint.bundle = hint.bundle ?? AssetBundle.LoadFromFile(hint.bundlePath); 184 | } 185 | private void HintRecyle(AssetBundleHint hint) 186 | { 187 | hint.mainAsset = null; 188 | hint.bundle.Unload(true); 189 | Object.Destroy(hint.bundle); 190 | hint.bundle = null; 191 | } 192 | private void HintReduceRefCount(AssetBundleHint hint) 193 | { 194 | foreach (var depHint in hint.dependenceList) 195 | { 196 | HintReduceRefCount(depHint); 197 | } 198 | 199 | hint.refCount--; 200 | if (hint.refCount == 0) 201 | { 202 | HintRecyle(hint); 203 | } 204 | } 205 | private void HintIncreaseRefCount(AssetBundleHint hint) 206 | { 207 | foreach (var depHint in hint.dependenceList) 208 | { 209 | HintIncreaseRefCount(depHint); 210 | } 211 | 212 | hint.refCount++; 213 | } 214 | #region async 215 | private void HintLoadAssetBundleAsync(AssetBundleHint hint, ResourceAsyncCallBack callback) 216 | { 217 | var mainRequest = new AsyncBundleCreateMainRequest(); 218 | var createRequest = HintCreateBundleAsync(hint); 219 | mainRequest.callback = callback; 220 | mainRequest.mainRequest = createRequest; 221 | 222 | AddAsyncCallback(mainRequest, OnAssetBundleLoadComplete); 223 | } 224 | 225 | private AsyncBundleCreateRequest HintCreateBundleAsync(AssetBundleHint hint) 226 | { 227 | var request = AssetBundle.LoadFromFileAsync(hint.bundlePath); 228 | 229 | var bundleRequest = new AsyncBundleCreateRequest(); 230 | bundleRequest.createRequest = request; 231 | bundleRequest.hint = hint; 232 | 233 | for (int i = 0, count = hint.dependenceList.Count; i < count; i++) 234 | { 235 | var depHint = hint.dependenceList[i]; 236 | if (depHint.bundle == null) 237 | { 238 | bundleRequest.dependenceRequestList.Add(HintCreateBundleAsync(depHint)); 239 | } 240 | } 241 | 242 | return bundleRequest; 243 | } 244 | private void OnAssetBundleLoadComplete(IAsyncResourceRequest request) 245 | { 246 | var mainCreateRequest = request as AsyncBundleCreateMainRequest; 247 | DealAsyncBundleCreateRequest(mainCreateRequest.mainRequest); 248 | 249 | DoHintLoadMainAssetAsync(mainCreateRequest.mainRequest.hint, mainCreateRequest.callback); 250 | } 251 | 252 | private void DealAsyncBundleCreateRequest(AsyncBundleCreateRequest request) 253 | { 254 | var createRequest = request; 255 | var hint = createRequest.hint; 256 | var assetbundle = createRequest.createRequest.assetBundle; 257 | if (hint.bundle == null) 258 | { 259 | hint.bundle = assetbundle; 260 | } 261 | else 262 | { 263 | assetbundle.Unload(true); 264 | } 265 | int depCount = createRequest.dependenceRequestList.Count; 266 | for (int i = 0; i < depCount; i++) 267 | { 268 | DealAsyncBundleCreateRequest(createRequest.dependenceRequestList[i]); 269 | } 270 | } 271 | 272 | private void HintLoadMainAssetAsync(AssetBundleHint hint, ResourceAsyncCallBack callBack) 273 | { 274 | //预定 275 | HintIncreaseRefCount(hint); 276 | if (hint.bundle == null) 277 | { 278 | HintLoadAssetBundleAsync(hint, callBack); 279 | return; 280 | } 281 | DoHintLoadMainAssetAsync(hint, callBack); 282 | } 283 | 284 | private void DoHintLoadMainAssetAsync(AssetBundleHint hint, ResourceAsyncCallBack callBack) 285 | { 286 | if (hint.mainAsset != null) 287 | { 288 | HintInvokeCallback(hint, callBack); 289 | return; 290 | } 291 | var request = hint.bundle.LoadAssetAsync(hint.assetName); 292 | 293 | var assetRequest = new AsyncAssetRequest(); 294 | assetRequest.request = request; 295 | assetRequest.callback = callBack; 296 | assetRequest.hint = hint; 297 | 298 | AddAsyncCallback(assetRequest, OnAssetLoadComplete); 299 | } 300 | 301 | private void OnAssetLoadComplete(IAsyncResourceRequest request) 302 | { 303 | var assetRequest = request as AsyncAssetRequest; 304 | var hint = assetRequest.hint; 305 | var callback = assetRequest.callback; 306 | var asset = assetRequest.request.asset; 307 | hint.mainAsset = asset; 308 | 309 | HintInvokeCallback(hint, callback); 310 | } 311 | 312 | private void HintInvokeCallback(AssetBundleHint hint, ResourceAsyncCallBack callback) 313 | { 314 | var resourceRequest = new AsyncResourceRequest(); 315 | var asset = hint.mainAsset; 316 | loadedAssetHintMap.Add(asset.GetInstanceID(), hint); 317 | resourceRequest.isDone = true; 318 | resourceRequest.asset = hint.mainAsset; 319 | 320 | callback(resourceRequest); 321 | } 322 | #endregion 323 | #endregion 324 | 325 | 326 | } 327 | 328 | 329 | } 330 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/BundleResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a4ea7fafe908214ea5cd443bb8df895 3 | timeCreated: 1505133986 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/EditorResourceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | 6 | namespace Monster.BaseSystem.ResourceManager 7 | { 8 | public class EditorResourceManager : BaseResourceManager 9 | { 10 | private HashSet _objSet; 11 | 12 | public override void Init(object data) 13 | { 14 | base.Init(data); 15 | _objSet = new HashSet(); 16 | } 17 | 18 | protected override Object DoLoad(string path, Type type, bool instantiate) 19 | { 20 | var asset = Resources.Load(path, type); 21 | var obj = instantiate ? Object.Instantiate(asset) : asset; 22 | if (instantiate) 23 | { 24 | _objSet.Add(obj); 25 | } 26 | return obj; 27 | } 28 | 29 | 30 | protected override void DoLoadAsync(string path, Type type, ResourceAsyncCallBack callBack) 31 | { 32 | var operation = Resources.LoadAsync(path, type); 33 | var resourceRequest = new AsyncOperationRequest(operation) {state = callBack}; 34 | AddAsyncCallback(resourceRequest, OnLoadAsyncComplete); 35 | } 36 | 37 | private void OnLoadAsyncComplete(IAsyncResourceRequest request) 38 | { 39 | var operationRequest = request as AsyncOperationRequest; 40 | var asset = (operationRequest.operation as ResourceRequest).asset; 41 | var callback = operationRequest.state as ResourceAsyncCallBack; 42 | callback(new AsyncResourceRequest() {asset = asset}); 43 | } 44 | 45 | protected override T DoLoad(string path) 46 | { 47 | return DoLoad(path,typeof(T), false) as T; 48 | } 49 | 50 | 51 | protected override void DoLoadAsync(string path, ResourceAsyncCallBack callBack) 52 | { 53 | DoLoadAsync(path, typeof(T), callBack); 54 | } 55 | 56 | protected override void DoUnLoadAsset(Object assetToUnload) 57 | { 58 | if (_objSet.Contains(assetToUnload)) 59 | { 60 | _objSet.Remove(assetToUnload); 61 | Object.Destroy(assetToUnload); 62 | return; 63 | } 64 | Resources.UnloadAsset(assetToUnload); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/EditorResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f02632e35f8e65a4cb1e80b2cf913958 3 | timeCreated: 1505133986 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Interface.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1bf9c363e48d3440885d7ea95af8da3 3 | folderAsset: yes 4 | timeCreated: 1505995165 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Interface/IAsyncResourceRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Monster.BaseSystem.ResourceManager 2 | { 3 | public interface IAsyncResourceRequest 4 | { 5 | string id { get; } 6 | bool isDone { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Interface/IAsyncResourceRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02f40c035fa508f48a6317a6dc13c9f0 3 | timeCreated: 1505995165 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Interface/IResourceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace Monster.BaseSystem.ResourceManager 6 | { 7 | public interface IResourceManager 8 | { 9 | void Init(object data); 10 | 11 | void Trik(); 12 | 13 | /// 14 | /// 加载prefab 15 | /// 16 | /// 17 | /// 已经实例化的GameObject 18 | GameObject LoadPrefab(string path); 19 | Object Load(string path); 20 | Object Load(string path, Type type); 21 | T Load(string path) where T : Object; 22 | void LoadAsync(string path, ResourceAsyncCallBack callBack); 23 | void LoadAsync(string path, ResourceAsyncCallBack callBack) where T : Object; 24 | void LoadAsync(string path, Type systemTypeInstance, ResourceAsyncCallBack callBack); 25 | void UnLoadAsset(Object assetToUnload); 26 | IAsyncResourceRequest UnLoadUnusedAssets(); 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/Interface/IResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a58d48f7b88942468efc4acdaffdc3f 3 | timeCreated: 1505995165 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/ResourceAsyncCallBack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Monster.BaseSystem.ResourceManager 7 | { 8 | public delegate void ResourceAsyncCallBack(IAsyncResourceRequest resourceRequest); 9 | } 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/BaseSystem/ResourceManager/ResourceAsyncCallBack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d9403fecf43d2d4a8e989c5100d567e 3 | timeCreated: 1505916203 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/LoadAsset.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Monster.BaseSystem; 4 | using Monster.BaseSystem.CoroutineTask; 5 | 6 | public class LoadAsset : MonoBehaviour 7 | { 8 | 9 | private AssetLoadTask _task; 10 | // Use this for initialization 11 | void Start () { 12 | _task = new AssetLoadTask(); 13 | StartCoroutine(_task.Run()); 14 | } 15 | 16 | private bool hasAdd = false; 17 | // Update is called once per frame 18 | void Update () { 19 | 20 | if (_task.IsCompleted && !hasAdd) 21 | { 22 | hasAdd = true; 23 | ResourcesFacade.Instance.Init(null); 24 | var panel = ResourcesFacade.Instance.LoadPrefab("Plane"); 25 | panel.transform.parent = transform; 26 | panel.transform.localPosition = Vector3.zero; 27 | panel.transform.localEulerAngles = Vector3.zero; 28 | } 29 | 30 | if (hasAdd) 31 | { 32 | ResourcesFacade.Instance.Trik(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/Scripts/LoadAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be752f124e82e06479de5d9f2f0d123c 3 | timeCreated: 1506049528 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/StreamingAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96528bd39681bc5468ee258c32abc861 3 | folderAsset: yes 4 | timeCreated: 1506049700 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/StreamingAssets/New Material.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/StreamingAssets/New Material.bytes -------------------------------------------------------------------------------- /MonsterABSystem/Assets/StreamingAssets/New Material.bytes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db4db8c948ffca54caf4a1a06b1a0fbb 3 | timeCreated: 1506049939 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/StreamingAssets/Plane.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/StreamingAssets/Plane.bytes -------------------------------------------------------------------------------- /MonsterABSystem/Assets/StreamingAssets/Plane.bytes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 692f14a95eb8c544a820fa3295e79cd4 3 | timeCreated: 1506050313 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Assets/scene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Assets/scene.unity -------------------------------------------------------------------------------- /MonsterABSystem/Assets/scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b677c47177971324eae17930e75a1cae 3 | timeCreated: 1506049544 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/AssetsConfig.bytes: -------------------------------------------------------------------------------- 1 | {"Plane":{"depenceList":[],"assetName":"Plane"}} -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/Bundles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Bundles/Bundles -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/Bundles.manifest: -------------------------------------------------------------------------------- 1 | ManifestFileVersion: 0 2 | CRC: 1100665140 3 | AssetBundleManifest: 4 | AssetBundleInfos: 5 | Info_0: 6 | Name: plane.bytes 7 | Dependencies: {} 8 | -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/new material.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Bundles/new material.bytes -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/new material.bytes.manifest: -------------------------------------------------------------------------------- 1 | ManifestFileVersion: 0 2 | CRC: 1725742835 3 | Hashes: 4 | AssetFileHash: 5 | serializedVersion: 2 6 | Hash: 393c288eebade8823e610dc61d31764e 7 | TypeTreeHash: 8 | serializedVersion: 2 9 | Hash: d7c08275c813a4630703081edab8d6bb 10 | HashAppended: 0 11 | ClassTypes: 12 | - Class: 21 13 | Script: {instanceID: 0} 14 | - Class: 48 15 | Script: {instanceID: 0} 16 | Assets: 17 | - Assets/BundleResources/New Material.mat 18 | Dependencies: [] 19 | -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/plane.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/Bundles/plane.bytes -------------------------------------------------------------------------------- /MonsterABSystem/Bundles/plane.bytes.manifest: -------------------------------------------------------------------------------- 1 | ManifestFileVersion: 0 2 | CRC: 66637180 3 | Hashes: 4 | AssetFileHash: 5 | serializedVersion: 2 6 | Hash: b1fe53911f3c8bfd0db189bc729bd252 7 | TypeTreeHash: 8 | serializedVersion: 2 9 | Hash: e91467a618b48d777c79d670b76571ae 10 | HashAppended: 0 11 | ClassTypes: 12 | - Class: 1 13 | Script: {instanceID: 0} 14 | - Class: 4 15 | Script: {instanceID: 0} 16 | - Class: 21 17 | Script: {instanceID: 0} 18 | - Class: 23 19 | Script: {instanceID: 0} 20 | - Class: 28 21 | Script: {instanceID: 0} 22 | - Class: 33 23 | Script: {instanceID: 0} 24 | - Class: 43 25 | Script: {instanceID: 0} 26 | - Class: 48 27 | Script: {instanceID: 0} 28 | - Class: 64 29 | Script: {instanceID: 0} 30 | Assets: 31 | - Assets/BundleResources/Plane.prefab 32 | - Assets/Materials/New Material.mat 33 | Dependencies: [] 34 | -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.4.3f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /MonsterABSystem/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siuming93/MonsterABSystem/dd0044193df52a539b410ebabf312870d36851f1/MonsterABSystem/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MonsterABSystem 2 | 基于根节点与依赖关系的Unity AssetBundle 打包与加载策略 3 | 4 | 点击 菜单 Tools/Show AssetBundle Builder 5 | 在弹出的面板中可以对打包参数进行配置 6 | 7 | Editor模式运行时会Log AssetBundle 的加载信息 8 | --------------------------------------------------------------------------------