private void UpdateAsset()
    {
        string path = AssetDatabase.GetAssetPath(resourseSetting);
        Dictionary <string, List <string> > msgDict = resourseSetting.GetAssetDict();
        //List<string> listRes = new List<string>(assetDict.Keys);
        List <string> ret = new List <string>();

        foreach (var item in assetDict)
        {
            if (item.Value)
            {
                string url = Application.dataPath + item.Key;//Path.Combine(Application.dataPath, item.Key);
                ret.Add(url);
                List <string> list = ResLibaryTool.GetAllSubDirs(url);
                if (list != null)
                {
                    ret.AddRange(list);
                }
            }
        }

        Debug.Log("ret:" + ret.Count);
        string dataPath = Application.dataPath.Replace("//", "/");

        dataPath = dataPath.Replace("\\", "/");
        dataPath = dataPath.Replace("\\\\", "/");
        for (int i = 0; i < ret.Count; i++)
        {
            string[] files = System.IO.Directory.GetFiles(ret[i]);
            for (int j = 0; j < files.Length; j++)
            {
                string file = files[j];

                string extension = Path.GetExtension(file);
                if (!ResLibaryConfig.ResourceExts.Contains(extension))
                {
                    continue;
                }

                file = file.Replace("//", "/");
                file = file.Replace("\\", "/");
                file = file.Replace("\\\\", "/");
                file = file.Replace(dataPath, "Assets");
                UnityEngine.Object obj = AssetDatabase.LoadMainAssetAtPath(file);
                if (obj == null)
                {
                    continue;
                }
                if (!ResLibaryConfig.ExistType.ContainsValue(obj.GetType().Name))
                {
                    continue;
                }
                if (obj.GetType().Name == ResLibaryConfig.ExistType[LibaryTypeEnum.LibaryType_Texture2D])
                {
                    string          resfile         = AssetDatabase.GetAssetPath(obj);
                    TextureImporter textureImporter = TextureImporter.GetAtPath(resfile) as TextureImporter;
                    if (textureImporter == null)
                    {
                        continue;
                    }
                    if (textureImporter.textureType == TextureImporterType.Sprite)
                    {
                        List <string> sDict = null;
                        msgDict.TryGetValue(ResLibaryConfig.ExistType[LibaryTypeEnum.LibaryType_Sprite], out sDict);
                        UnityEngine.Object[] sprs = AssetDatabase.LoadAllAssetsAtPath(resfile);
                        for (int k = 0; k < sprs.Length; k++)
                        {
                            if (sprs[k].GetType().Name == ResLibaryConfig.ExistType[LibaryTypeEnum.LibaryType_Sprite])
                            {
                                if (sDict != null && sDict.Contains(sprs[k].name))
                                {
                                    continue;
                                }
                                resourseSetting.AddResToLibary(sprs[k]);
                            }
                            else
                            {
                                List <string> sDictT = null;
                                msgDict.TryGetValue(ResLibaryConfig.ExistType[LibaryTypeEnum.LibaryType_Texture2D], out sDictT);
                                if (sDictT != null && sDictT.Contains(sprs[k].name))
                                {
                                    continue;
                                }
                                resourseSetting.AddResToLibary(sprs[k]);
                            }
                        }
                    }
                    else
                    {
                        List <string> sDict = null;
                        msgDict.TryGetValue(ResLibaryConfig.ExistType[LibaryTypeEnum.LibaryType_Texture2D], out sDict);
                        if (sDict != null && sDict.Contains(obj.name))
                        {
                            continue;
                        }
                        resourseSetting.AddResToLibary(obj);
                    }
                }
                else
                {
                    List <string> sDict = null;
                    msgDict.TryGetValue(obj.GetType().Name, out sDict);
                    if (sDict != null && sDict.Contains(obj.name))
                    {
                        continue;
                    }
                    resourseSetting.AddResToLibary(obj);
                }
            }
        }
        AssetDatabase.ImportAsset(path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }
    static void RemoveResource()
    {
        LibaryAssetSetting _assetSetting = Resources.Load <LibaryAssetSetting>("AssetLibarySetting");

        if (_assetSetting == null)
        {
            return;
        }
        string             path         = AssetDatabase.GetAssetPath(_assetSetting);
        LibaryAssetSetting assetSetting = AssetDatabase.LoadAssetAtPath <LibaryAssetSetting>(path);

        if (assetSetting == null)
        {
            return;
        }
        // 选择的要保存的对象
        Dictionary <string, List <string> > dictMsg = assetSetting.GetAssetDict();

        Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
        foreach (Object item in selection)
        {
            if (item == null || item.GetType() == typeof(DefaultAsset))
            {
                continue;
            }
            if (ResLibaryConfig.ExistType.ContainsValue(item.GetType().Name))
            {
                if (item.GetType() == typeof(Texture2D))
                {
                    string          tex2dpath       = AssetDatabase.GetAssetPath(item);
                    TextureImporter textureImporter = TextureImporter.GetAtPath(tex2dpath) as TextureImporter;
                    if (textureImporter.textureType == TextureImporterType.Sprite)
                    {
                        Object[] sprs = AssetDatabase.LoadAllAssetsAtPath(tex2dpath);
                        for (int i = 0; i < sprs.Length; i++)
                        {
                            Object spr = sprs[i];

                            if (spr != null && spr.GetType() == typeof(Sprite))
                            {
                                List <string> sprslist;
                                dictMsg.TryGetValue(spr.GetType().Name, out sprslist);
                                if (sprslist != null && sprslist.Contains(spr.name))
                                {
                                    int dindex = sprslist.FindLastIndex(x => x == spr.name);
                                    assetSetting.DelResToLibary(spr.GetType().Name, dindex);
                                }
                            }
                        }

                        if (textureImporter.spriteImportMode != SpriteImportMode.Multiple)
                        {
                            List <string> sprslist;
                            dictMsg.TryGetValue(item.GetType().Name, out sprslist);
                            if (sprslist != null && sprslist.Contains(item.name))
                            {
                                int dindex = sprslist.FindLastIndex(x => x == item.name);
                                assetSetting.DelResToLibary(item.GetType().Name, dindex);
                            }
                        }
                    }
                }
            }
            else
            {
                List <string> sprslist;
                dictMsg.TryGetValue(item.GetType().Name, out sprslist);
                if (sprslist != null && sprslist.Contains(item.name))
                {
                    int dindex = sprslist.FindLastIndex(x => x == item.name);
                    assetSetting.DelResToLibary(item.GetType().Name, dindex);
                }
            }
        }
        AssetDatabase.ImportAsset(path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }