private void HandleUnityEngineLog(string logString, string stackTrace, LogType type) { LogWrapper wrapper = ReferenceSystem.Spawn <LogWrapper>(); wrapper.Type = type; wrapper.Log = $"[{type}] {logString}"; _logs.Add(wrapper); if (_logs.Count > LOG_MAX_COUNT) { ReferenceSystem.Release(_logs[0]); _logs.RemoveAt(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(); }