示例#1
0
        /// <summary>
        /// 添加保留文件
        /// </summary>
        public static void AddOnlyInclusionFiles(bool delete = false)
        {
            string abName = "";
            string apath  = "";

            Object[] selection = EditorUtils.SelectObjects(); //typeof(GameObject),typeof(Texture2D));
            foreach (Object s in selection)
            {
                abName = GetOriginalAssetBundleName(s, out apath);
                if (string.IsNullOrEmpty(abName))
                {
                    continue;
                }

                if (delete)
                {
                    HugulaExtensionFolderEditor.RemoveExtendsFile(abName);
                }
                else if (!string.IsNullOrEmpty(abName) && !HugulaExtensionFolderEditor.ContainsExtendsPath(apath))
                {
                    HugulaExtensionFolderEditor.AddOnlyInclusionFiles(abName);
                }
                else
                {
                    Debug.LogFormat("assetPath({0}) can't add to extends file list  ", abName);
                }
            }

            HugulaExtensionFolderEditor.SaveSettingData();
        }
示例#2
0
        public static void AddOnlyInclusionFilesByTxt()
        {
            Object[] selection = Selection.objects;

            foreach (Object s in selection)
            {
                if (s is TextAsset)
                {
                    string   txt = ((TextAsset)s).text;
                    string[] sps = txt.Split('\n');
                    Debug.Log(s);
                    foreach (var str in sps)
                    {
                        if (!string.IsNullOrEmpty(str.Trim()))
                        {
                            HugulaExtensionFolderEditor.AddOnlyInclusionFiles(str.Trim());
                        }
                    }
                }
            }

            HugulaExtensionFolderEditor.SaveSettingData();
        }