private void Init() { BMDataAccessor.Refresh(); includeRefDict.Clear(); dependRefDict.Clear(); bundleDict.Clear(); foreach (BundleData bundle in BMDataAccessor.Bundles) { if (!bundleDict.ContainsKey(bundle.name)) { bundleDict.Add(bundle.name, bundle); } else { Debug.LogError("Bundle manger -- Cannot have two bundle with same name [" + bundle.name + "]"); } foreach (string guid in bundle.includeGUIDs) { AddIncludeRef(guid, bundle); } AddDependRefs(bundle); } foreach (var bundle in bundleDict.Values) { if (!string.IsNullOrEmpty(bundle.parent)) { bundleDict[bundle.parent].GetChildren().Add(bundle.name); } } foreach (var bundle in bundleDict.Values) { bundle.GetChildren().Sort(); } statesDict.Clear(); foreach (BundleBuildState buildState in BMDataAccessor.BuildStates) { if (!statesDict.ContainsKey(buildState.bundleName)) { statesDict.Add(buildState.bundleName, buildState); } else { Debug.LogError("Bundle manger -- Cannot have two build states with same name [" + buildState.bundleName + "]"); } } UpdateAllBundlesNeedBuild(); }
private void Init() { BMDataAccessor.Refresh(); statesDict.Clear(); includeRefDict.Clear(); dependRefDict.Clear(); foreach (BundleBuildState buildState in BMDataAccessor.BuildStates) { if (!statesDict.ContainsKey(buildState.bundleName)) { statesDict.Add(buildState.bundleName, buildState); } else { EB.Debug.LogError("Bundle manger -- Cannot have two build states with same name [{0}]", buildState.bundleName); } } bundleDict.Clear(); foreach (BundleData bundle in BMDataAccessor.Bundles) { if (!bundleDict.ContainsKey(bundle.name)) { bundleDict.Add(bundle.name, bundle); } else { EB.Debug.LogError("Bundle manger -- Cannot have two bundle with same name [{0}]", bundle.name); } if (!statesDict.ContainsKey(bundle.name)) { statesDict.Add(bundle.name, new BundleBuildState()); // Don't have build state of the this bundle. Add a new one. } foreach (string guid in bundle.includeGUIDs) { AddIncludeRef(guid, bundle); } foreach (string guid in bundle.exIncludeGUIDs) { AddExIncludeRef(guid, bundle); } AddDependRefs(bundle); } }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (string asset in importedAssets) { if (asset == BMDataAccessor.BundleDataPath || asset == BMDataAccessor.BundleBuildStatePath) { if (isDateChangedManually(asset)) { BundleManager.RefreshAll(); } } else if (asset == BMDataAccessor.BMConfigerPath || asset == BMDataAccessor.UrlDataPath) { if (isDateChangedManually(asset)) { BMDataAccessor.Refresh(); } } } }