| | |
| | | static List<NewBieGuideScriptableObject> newbieGuides = new List<NewBieGuideScriptableObject>(); |
| | | static List<SoSkill> soSkills = new List<SoSkill>(); |
| | | static List<AnalyzeTask> tasks = new List<AnalyzeTask>(); |
| | | static string ignorekeys = string.Empty; |
| | | |
| | | [MenuItem("程序/Effect Assets/移除无用的EffectKey")] |
| | | public static void Remove() |
| | |
| | | uieffects = GetEffectComponents(); |
| | | soSkills = GetSoSkills(); |
| | | newbieGuides = GetNewbieGuides(); |
| | | ignorekeys = GetIngoreKeys(); |
| | | |
| | | try |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (IsIgnoreKey(info.key, ref ignorekeys)) |
| | | { |
| | | Debug.LogFormat("找到一个不要删除的 effect key:{0}", info.key); |
| | | continue; |
| | | } |
| | | |
| | | if (ContainBySoSkills(info.key, ref soSkills)) |
| | | { |
| | | Debug.LogFormat("找到一个被soskill依赖的 effect key:{0}", info.key); |
| | |
| | | if (ContainByCSharpFile(info.key, ref csharpFileContents)) |
| | | { |
| | | Debug.LogFormat("找到一个写在C#文件中的 effect key:{0}", info.key); |
| | | continue; |
| | | } |
| | | |
| | | if (ContainByPrefab(info.key, ref uieffects)) |
| | | { |
| | | Debug.LogFormat("找到一个被prefab依赖的 effect key:{0}", info.key); |
| | | continue; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | var soskills = new List<SoSkill>(); |
| | | foreach ( var path in assetPaths) |
| | | foreach (var path in assetPaths) |
| | | { |
| | | var soskill = AssetDatabase.LoadAssetAtPath<SoSkill>(path); |
| | | if ( soskill!=null) |
| | | if (soskill != null) |
| | | { |
| | | soskills.Add(soskill); |
| | | } |
| | |
| | | } |
| | | |
| | | return newbieguides; |
| | | } |
| | | |
| | | static string GetIngoreKeys() |
| | | { |
| | | return File.ReadAllText(Application.dataPath + "/Editor/Config/DeleteEffectExcludeKey.txt"); |
| | | } |
| | | |
| | | static bool ContainByTables(string key, ref List<Column> columns) |
| | |
| | | return false; |
| | | } |
| | | |
| | | static bool IsIgnoreKey(string key, ref string ignores) |
| | | { |
| | | return Regex.IsMatch(ignores, key); |
| | | } |
| | | |
| | | static void OnUpdate() |
| | | { |
| | | var done = true; |