diff options
Diffstat (limited to 'Assets/ActionTool/Editor/ActionEditor.cs')
-rw-r--r-- | Assets/ActionTool/Editor/ActionEditor.cs | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Assets/ActionTool/Editor/ActionEditor.cs b/Assets/ActionTool/Editor/ActionEditor.cs index 2abe9a2b..15b8e9f1 100644 --- a/Assets/ActionTool/Editor/ActionEditor.cs +++ b/Assets/ActionTool/Editor/ActionEditor.cs @@ -163,13 +163,8 @@ namespace ActionTool bool isFavorite = false;
if (animationAssets != null && animationAssets.ContainsKey(file))
{
- var labels = AssetDatabase.GetLabels(animationAssets[file]);
- for (int j = 0; j < labels.Length; ++j)
- {
- if (labels[j] == "GoodAnimation")
- isFavorite = true;
- }
- }
+ isFavorite = IsFavoritAnimation(animationAssets[file]);
+ }
if ((!animationAssets.ContainsKey(file) || animationAssets[file] == null) && coLoadAnimationAssets == null)
{
coLoadAnimationAssets = CoLoadAnimationAssets();
@@ -209,7 +204,18 @@ namespace ActionTool }
}
- IEnumerator CoLoadAnimationAssets()
+ bool IsFavoritAnimation(Object animationFile)
+ {
+ var labels = AssetDatabase.GetLabels(animationFile);
+ for (int j = 0; j < labels.Length; ++j)
+ {
+ if (labels[j] == "GoodAnimation")
+ return true;
+ }
+ return false;
+ }
+
+ IEnumerator CoLoadAnimationAssets()
{
if (!ActionManager.HasSelectObj())
yield break;
@@ -237,8 +243,11 @@ namespace ActionTool {
animationAssets.Add(file, animFile);
}
- this.Repaint();
- yield return null;
+ if (IsFavoritAnimation(animFile))
+ {
+ this.Repaint();
+ }
+ yield return null;
}
}
|