예제 #1
0
        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;
            }
            BMDataAccessor.SaveImportData();

            RefreshDataWithSelect();
            if (m_dataTable != null)
            {
                m_dataTable.SetSelected(temp);
            }
        }
예제 #2
0
        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 = AssetDepend.GetDependenciesCache(list[i]);
                for (int j = 0; j < dep.Length; ++j)
                {
                    if (string.IsNullOrEmpty(dep[j]))
                    {
                        continue;
                    }
                    _ProcessSpecialResource(dep[j]);
                    BundleImportData data = m_dataControl.GetPathSelectData(dep[j]);
                    if (data != null && !data.SkipData)
                    {
                        _AddPathToBundleByPathConfig(data, dep[j]);
                    }
                }
            }
            EditorUtility.ClearProgressBar();

            BMDataAccessor.SaveData();
            AssetDatabase.SaveAssets();
        }
예제 #3
0
 public void AddData()
 {
     m_editorData.Index = m_dataList.Count;
     m_dataList.Add(m_editorData);
     m_editorData = new BundleImportData();
     m_index      = -1;
     BMDataAccessor.SaveImportData();
     RefreshDataWithSelect();
 }
예제 #4
0
 public void DeleteCurrentData()
 {
     if (m_index == -1)
     {
         return;
     }
     m_dataList.RemoveAt(m_index);
     m_index      = -1;
     m_editorData = new BundleImportData();
     BMDataAccessor.SaveImportData();
     RefreshDataWithSelect();
 }
예제 #5
0
        private static void Init()
        {
            BMDataAccessor.Refresh();
            Clear();

            foreach (BundleState bundleState in BMDataAccessor.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 BMDataAccessor.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]);
                    }
                }
            }
        }
예제 #6
0
        public void SaveData()
        {
            if (m_index == -1)
            {
                return;
            }
            BundleImportData data = m_dataList[m_index];

            data.ClearObject();
            data.CopyData(m_editorData);
            OnDataSelected(data, m_index);
            BMDataAccessor.SaveImportData();
            RefreshDataWithSelect();
        }