Ejemplo n.º 1
0
 void AddIgnoreConst(string name)
 {
     if (!IgnoreConstSet.Contains(name))
     {
         IgnoreConstSet.Add(name);
     }
 }
Ejemplo n.º 2
0
 public bool IsInIgnoreConst(string name)
 {
     return(IgnoreConstSet.Contains(name));
 }
Ejemplo n.º 3
0
        //刷新DLC
        public void RefreshDLC()
        {
            Config.Clear();
            AllDirectory.Clear();
            CopyDirectory.Clear();
            IgnoreConstSet.Clear();

            ConfigExtend.Clear();
            ConfigAll.Clear();

            EditorExtend.Clear();
            EditorAll.Clear();

            foreach (var item in BuildRule)
            {
                AddBuildConfig(item);
            }
            foreach (var item in IgnoreConst)
            {
                AddIgnoreConst(item);
            }

            //加载内部dlc
            ConfigInternal = new DLCItemConfig(Const.STR_InternalDLC);
            EditorInternal = new DLCItem(ConfigInternal);

            //加载原生dlc
            ConfigNative = new DLCItemConfig(Const.STR_NativeDLC);
            EditorNative = new DLCItem(ConfigNative);

            //加载其他额外DLC
            foreach (var item in DLC)
            {
                var dlcItem = new DLCItemConfig(item.Name);
                ConfigExtend.Add(dlcItem);
                EditorExtend.Add(new DLCItem(dlcItem));
            }

            ConfigAll = new List <DLCItemConfig>(ConfigExtend);
            ConfigAll.Add(ConfigInternal);
            ConfigAll.Add(ConfigNative);

            EditorAll = new List <DLCItem>(EditorExtend);
            EditorAll.Add(EditorInternal);
            EditorAll.Add(EditorNative);

#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                foreach (var item in AllDirectory)
                {
                    FileUtil.EnsureDirectory(Path.Combine(Const.Path_NativeDLC, item));
                }

                foreach (var item in DLC)
                {
                    foreach (var dic in AllDirectory)
                    {
                        FileUtil.EnsureDirectory(Path.Combine(Const.Path_Bundles, item.Name, dic));
                    }
                }
            }
#endif
        }