少年修仙传客户端基础资源
client_Wu Xijin
2019-03-14 a1587a7869992feb04a040cea3d7eb6c14dc0246
3335 用editor下的 deleteStar删除 resourceout 下的带有星星的prefab文件
1个文件已修改
2个文件已添加
52 ■■■■■ 已修改文件
Assets/Editor/Tool/DeleteStar.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/DeleteStar.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/FormatPrefabTool.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/DeleteStar.cs
New file
@@ -0,0 +1,36 @@
using 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");
    }
}
Assets/Editor/Tool/DeleteStar.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7142d5940d94a894bb2fe4bd700bb1e3
timeCreated: 1552014020
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
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: