From a1587a7869992feb04a040cea3d7eb6c14dc0246 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 14 三月 2019 20:15:11 +0800
Subject: [PATCH] 3335 用editor下的 deleteStar删除 resourceout 下的带有星星的prefab文件

---
 Assets/Editor/Tool/DeleteStar.cs.meta  |   12 ++++++++++++
 Assets/Editor/Tool/FormatPrefabTool.cs |    4 ++--
 Assets/Editor/Tool/DeleteStar.cs       |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/Assets/Editor/Tool/DeleteStar.cs b/Assets/Editor/Tool/DeleteStar.cs
new file mode 100644
index 0000000..d320973
--- /dev/null
+++ b/Assets/Editor/Tool/DeleteStar.cs
@@ -0,0 +1,36 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using Snxxz.UI;
+using UnityEngine;
+using UnityEditor;
+
+public class DeleteStar : MonoBehaviour {
+
+    [MenuItem("Prefab/DeleteStar")]
+    private static void DeleteStarInPrefab()
+    {
+        string[] ids = AssetDatabase.FindAssets("t:Prefab",new string[] { "Assets/ResourcesOut/UI/PriorityWindow" });
+        //string[] path = new string[ids.Length];
+        for(int i=0;i<ids.Length;i++)
+        {
+            string path= AssetDatabase.GUIDToAssetPath(ids[i]);
+            GameObject getObj = AssetDatabase.LoadAssetAtPath<GameObject>(path);
+            ItemCell[] itemCellList = getObj.transform.GetComponentsInChildren<ItemCell>(true);//杩斿洖杩欎釜鐗╀綋涓嬬殑item瀵瑰舰璞$殑item鑴氭湰鏁扮粍
+            if (itemCellList == null)
+            {
+                continue;
+            }
+            foreach (var itemCell in itemCellList)
+            {
+                if (itemCell.starlist != null)
+                {
+                    DestroyImmediate(itemCell.starlist, true);
+                    EditorUtility.SetDirty(getObj);
+                }
+            }  
+        }
+        AssetDatabase.SaveAssets();
+        AssetDatabase.Refresh();
+        //GameObject getObj = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/ResourcesOut/UI/Window/test/StarTestObj.prefab");
+    }
+}
diff --git a/Assets/Editor/Tool/DeleteStar.cs.meta b/Assets/Editor/Tool/DeleteStar.cs.meta
new file mode 100644
index 0000000..9412083
--- /dev/null
+++ b/Assets/Editor/Tool/DeleteStar.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7142d5940d94a894bb2fe4bd700bb1e3
+timeCreated: 1552014020
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Assets/Editor/Tool/FormatPrefabTool.cs b/Assets/Editor/Tool/FormatPrefabTool.cs
index 0066869..6ce52b8 100644
--- a/Assets/Editor/Tool/FormatPrefabTool.cs
+++ b/Assets/Editor/Tool/FormatPrefabTool.cs
@@ -296,9 +296,9 @@
                             }
                             break;
                         case ItemCellComType.Lock:
-                            if (_item.bindIcon != null)
+                            if (_item.auctionIcon != null)
                             {
-                                PasteImage(_item.bindIcon, _source.image);
+                                PasteImage(_item.auctionIcon, _source.image);
                             }
                             break;
                         case ItemCellComType.Reduce:

--
Gitblit v1.8.0