public void ModifDataPriority(bool up) { if (m_index == -1) { return; } var temp = m_dataList[m_index]; if (up) { if (m_index == 0) { return; } m_dataList[m_index] = m_dataList[m_index - 1]; m_dataList[m_index - 1] = temp; } else { if (m_index + 1 == m_dataList.Count) { return; } m_dataList[m_index] = m_dataList[m_index + 1]; m_dataList[m_index + 1] = temp; } BundleDataAccessor.SaveImportData(); RefreshDataWithSelect(); if (m_dataTable != null) { m_dataTable.SetSelected(temp); } }
public static void RemoveAllBundle() { BundleDataAccessor.Datas.Clear(); BundleDataAccessor.States.Clear(); Clear(); BundleDataAccessor.SaveData(); }
public static void CreateBundles() { PreProcessSpecialBundle(); List <string> list = m_dataControl.GetPublishPackagePath(); for (int i = 0; i < list.Count; ++i) { string name = Path.GetFileName(list[i]); if (EditorUtility.DisplayCancelableProgressBar("Create Bundle", name, (i * 1.0f) / list.Count)) { Debug.LogWarning("[BundleAdapter] CreateBundles Stop."); break; } string[] dep = AssetDepot.GetDependenciesCache(list[i]); for (int j = 0; j < dep.Length; ++j) { if (string.IsNullOrEmpty(dep[j])) { continue; } ProcessSpecialResource(dep[j]); BundleImportData data = m_dataControl.GetPathImportData(dep[j]); if (data != null && !data.SkipData) { _AddPathToBundleByImportData(data, dep[j]); } } } EditorUtility.ClearProgressBar(); BundleDataAccessor.SaveData(); AssetDatabase.SaveAssets(); }
public static void BuildBundles() { BundleBuildHelper.PushAssetDependencies(); BuildSingleBundle(BundleName.BN_SCRIPT, null); BundleData shader = BundleDataManager.GetBundleData(BundleName.BN_SHADER); for (int i = 0; shader != null && i < shader.children.Count; ++i) { BundleData shaderChild = BundleDataManager.GetBundleData(shader.children[i]); BundleState childState = BundleDataManager.GetBundleState(shader.children[i]); bool result = BundleBuildHelper.BuildShaderBundle(shaderChild, childState); if (!result) { Debug.LogErrorFormat("[BundleAdapter] BuildShaderBundle {0} Failed.", shader.children[i]); } } List <BundleImportData> dataList = m_dataControl.DataList; for (int i = 0; i < dataList.Count; ++i) { BundleImportData data = dataList[i]; string parentName = BundleDataManager.GetIndexBundleName(i); BuildSingleBundle(parentName, data); } BundleBuildHelper.PopAssetDependencies(); BundleDataAccessor.SaveData(); BundleExport.ExportBundleMainfestToOutput(); AssetDatabase.SaveAssets(); }
public void AddData() { m_editorData.Index = m_dataList.Count; m_dataList.Add(m_editorData); m_editorData = new BundleImportData(); m_index = -1; BundleDataAccessor.SaveImportData(); RefreshDataWithSelect(); }
public void DeleteCurrentData() { if (m_index == -1) { return; } m_dataList.RemoveAt(m_index); m_index = -1; m_editorData = new BundleImportData(); BundleDataAccessor.SaveImportData(); RefreshDataWithSelect(); }
public static void Init() { BundleDataAccessor.Refresh(); Clear(); foreach (BundleState bundleState in BundleDataAccessor.States) { if (!m_stateDict.ContainsKey(bundleState.bundleID)) { m_stateDict.Add(bundleState.bundleID, bundleState); } else { Debug.LogError("[BundleDataManager] Bundle State Conflict " + bundleState.bundleID); } } foreach (BundleData bundleData in BundleDataAccessor.Datas) { if (!m_dataDict.ContainsKey(bundleData.name)) { m_dataDict.Add(bundleData.name, bundleData); } else { Debug.LogError("[BundleDataManager] Bundle Data Conflict " + bundleData.name); } BundleType type = bundleData.type; if (!m_typeCount.ContainsKey(type)) { m_typeCount.Add(type, 1); } else { ++m_typeCount[type]; } for (int i = 0; i < bundleData.includs.Count; ++i) { string guid = AssetDatabase.AssetPathToGUID(bundleData.includs[i]); if (!m_guidToBundle.ContainsKey(guid)) { m_guidToBundle.Add(guid, bundleData.name); } else { Debug.LogError("[BundleDataManager] Include Path Conflict " + bundleData.includs[i]); } } } }
public void SaveData() { if (m_index == -1) { return; } BundleImportData data = m_dataList[m_index]; data.ClearObject(); data.CopyData(m_editorData); OnDataSelected(data, m_index); BundleDataAccessor.SaveImportData(); RefreshDataWithSelect(); }