Exemple #1
0
    /// <summary>
    /// 获取显示列表
    /// </summary>
    private string[] GetShowInfos()
    {
        // 清空列表
        _cacheInfos.Clear();

        var fileLoaders = AssetSystem.DebugAllLoaders();

        foreach (var loader in fileLoaders)
        {
            // 只搜索关键字
            if (string.IsNullOrEmpty(_searchKey) == false)
            {
                if (loader.LoadPath.Contains(_searchKey) == false)
                {
                    continue;
                }
            }

            string showInfo = EditorTools.Substring(loader.LoadPath, "/assets/", false);
            showInfo = showInfo.Replace(".unity3d", string.Empty);
            showInfo = $"{showInfo} = {loader.RefCount}";

            // 添加到显示列表
            _cacheInfos.Add(showInfo);
        }

        // 重新排序
        var array = _cacheInfos.ToArray();

        System.Array.Sort(array, string.CompareOrdinal);
        return(array);
    }
Exemple #2
0
        private void FilterInfos()
        {
            // 回收引用
            ReferenceSystem.Release(_cacheInfos);

            // 清空列表
            _cacheInfos.Clear();

            // 绘制显示列表
            var fileLoaders = AssetSystem.DebugAllLoaders();

            _loaderTotalCount = fileLoaders.Count;
            foreach (var loader in fileLoaders)
            {
                // 只搜索关键字
                if (string.IsNullOrEmpty(_filterKey) == false)
                {
                    if (loader.LoadPath.Contains(_filterKey) == false)
                    {
                        continue;
                    }
                }

                string info = Substring(loader.LoadPath, "/assets/");
                info = info.Replace(".unity3d", string.Empty);
                info = $"{info} = {loader.RefCount}";

                InfoWrapper element = ReferenceSystem.Spawn <InfoWrapper>();
                element.Info                = info;
                element.LoadState           = loader.States;
                element.ProviderFailedCount = loader.GetFailedProviderCount();

                // 添加到显示列表
                _cacheInfos.Add(element);
            }

            // 重新排序
            _cacheInfos.Sort();
        }