From f6a774b04d77296279bbbf25603cbfed4170eacc Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 17 四月 2019 14:53:50 +0800
Subject: [PATCH] 6519 【工具】【2.0】删除无用KYE的工具
---
Assets/Editor/Config/DeleteEffectExcludeKey.txt.meta | 8 ++++++++
Assets/Editor/Config/DeleteEffectExcludeKey.txt | 0
Assets/Editor/Tool/EffectAssetCheck.cs | 28 ++++++++++++++++++++--------
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/Assets/Editor/Config/DeleteEffectExcludeKey.txt b/Assets/Editor/Config/DeleteEffectExcludeKey.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Assets/Editor/Config/DeleteEffectExcludeKey.txt
diff --git a/Assets/Editor/Config/DeleteEffectExcludeKey.txt.meta b/Assets/Editor/Config/DeleteEffectExcludeKey.txt.meta
new file mode 100644
index 0000000..713ca3d
--- /dev/null
+++ b/Assets/Editor/Config/DeleteEffectExcludeKey.txt.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e56f0106efd9a1042896c1ed2a404ddf
+timeCreated: 1555483751
+licenseType: Pro
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Editor/Tool/EffectAssetCheck.cs b/Assets/Editor/Tool/EffectAssetCheck.cs
index 062abd6..cb997a1 100644
--- a/Assets/Editor/Tool/EffectAssetCheck.cs
+++ b/Assets/Editor/Tool/EffectAssetCheck.cs
@@ -287,6 +287,7 @@
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/绉婚櫎鏃犵敤鐨凟ffectKey")]
public static void Remove()
@@ -318,6 +319,7 @@
uieffects = GetEffectComponents();
soSkills = GetSoSkills();
newbieGuides = GetNewbieGuides();
+ ignorekeys = GetIngoreKeys();
try
{
@@ -348,6 +350,12 @@
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);
@@ -375,12 +383,6 @@
if (ContainByCSharpFile(info.key, ref csharpFileContents))
{
Debug.LogFormat("鎵惧埌涓�涓啓鍦–#鏂囦欢涓殑 effect key锛歿0}", info.key);
- continue;
- }
-
- if (ContainByPrefab(info.key, ref uieffects))
- {
- Debug.LogFormat("鎵惧埌涓�涓prefab渚濊禆鐨� effect key锛歿0}", info.key);
continue;
}
@@ -585,10 +587,10 @@
}
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);
}
@@ -619,6 +621,11 @@
}
return newbieguides;
+ }
+
+ static string GetIngoreKeys()
+ {
+ return File.ReadAllText(Application.dataPath + "/Editor/Config/DeleteEffectExcludeKey.txt");
}
static bool ContainByTables(string key, ref List<Column> columns)
@@ -715,6 +722,11 @@
return false;
}
+ static bool IsIgnoreKey(string key, ref string ignores)
+ {
+ return Regex.IsMatch(ignores, key);
+ }
+
static void OnUpdate()
{
var done = true;
--
Gitblit v1.8.0