Example #1
0
        public static void FindUsePrefab()
        {
            string path = AssetDatabase.GetAssetPath(Selection.activeObject);

            if (Instance == null)
            {
                Init();
                Find();
            }
            _AssetUsedData = new AssetUsedData(path);
            _AssetUsedData.FindUsed(_prefabs);
            _repaint = true;
        }
Example #2
0
        void ShowTest()
        {
            bool change = false;

            EditorGUILayout.BeginHorizontal();
            if (_AssetType != null)
            {
                _SelectAssetType = EditorGUILayout.Popup("查询文件类型:", _SelectAssetType, _AssetType, GUILayout.MaxWidth(300));
                if (GUI.changed)
                {
                    change = true;
                    EditorGUILayout.EndHorizontal();
                    _artFindSet._onlyShowNoUsed = false;
                    _AllAssetsData.GetDepend(_SelectAssetType, _prefabs);
                }
            }
            if (!change)
            {
                EditorGUILayout.EndHorizontal();
            }
            if (_AssetUsedData != null)
            {
                if (GUILayout.Button("查看全局数据"))
                {
                    _AssetUsedData = null;
                }
                if (_AssetUsedData != null)
                {
                    _AssetUsedData.OnGUI();
                }
            }
            if (_AssetUsedData == null && _SelectAssetType != -1)
            {
                _artFindSet._onlyShowNoUsed = EditorGUILayout.Toggle(!_artFindSet._onlyShowNoUsed ? "显示使用的" : "显示未使用的", _artFindSet._onlyShowNoUsed);
                EditorGUILayout.LabelField(_AssetType[_SelectAssetType] + "总资源数:" + _AllAssetsData._data[_SelectAssetType]._allAssets);
                EditorGUILayout.LabelField(_AssetType[_SelectAssetType] + "被使用数:" + _AllAssetsData._data[_SelectAssetType]._allUsedAssets);
                EditorGUILayout.LabelField(_AssetType[_SelectAssetType] + "未使用数:" + _AllAssetsData._data[_SelectAssetType]._allUnUsedAssets);
                pos = EditorGUILayout.BeginScrollView(pos);
                _AllAssetsData.OnGUI(_SelectAssetType, _artFindSet);
                EditorGUILayout.EndScrollView();
            }
        }