| using System.Collections; | 
| using System.Collections.Generic; | 
| using Snxxz.UI; | 
| using UnityEngine; | 
| using UnityEditor; | 
| using System; | 
|   | 
| public class DeleteStar : MonoBehaviour | 
| { | 
|   | 
|     private static void DeleteStarInPrefab() | 
|     { | 
|         try | 
|         { | 
|             var ids = new List<string>(); | 
|             ids.AddRange(AssetDatabase.FindAssets("t:Prefab", new string[] { "Assets/ResourcesOut/UI/Window" })); | 
|             ids.AddRange(AssetDatabase.FindAssets("t:Prefab", new string[] { "Assets/ResourcesOut/UI/PriorityWindow" })); | 
|             ids.AddRange(AssetDatabase.FindAssets("t:Prefab", new string[] { "Assets/ResourcesOut/UI/Prefab" })); | 
|   | 
|             var totalCount = ids.Count; | 
|             for (int i = 0; i < ids.Count; i++) | 
|             { | 
|                 var path = AssetDatabase.GUIDToAssetPath(ids[i]); | 
|                 EditorUtility.DisplayProgressBar("整理ItemCell", string.Format("整理:{0}", path), i / (float)totalCount); | 
|                 var getObj = AssetDatabase.LoadAssetAtPath<GameObject>(path); | 
|                 var itemCellList = getObj.transform.GetComponentsInChildren<ItemCell>(true);//返回这个物体下的item对形象的item脚本数组 | 
|                 if (itemCellList == null) | 
|                 { | 
|                     continue; | 
|                 } | 
|             } | 
|         } | 
|         catch (Exception ex) | 
|         { | 
|             Debug.Log(ex); | 
|         } | 
|         finally | 
|         { | 
|             AssetDatabase.SaveAssets(); | 
|             AssetDatabase.Refresh(); | 
|             EditorUtility.ClearProgressBar(); | 
|         } | 
|   | 
|     } | 
|   | 
| } |