Skip to content

Commit

Permalink
[fix][runtime]:修复分析器对象池信息窗口的显示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CatImmortal committed Feb 28, 2023
1 parent 283f277 commit cbe3346
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private static void BuildProfilerPoolInfo(ProfilerInfo info)
}

ppi.UsedCount = usedCount;
ppi.UnusedTimer = ppi.AllCount - ppi.UsedCount;
ppi.UnusedCount = ppi.AllCount - ppi.UsedCount;
}
info.PoolInfoList.Sort();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static BundleRuntimeInfo()
{
if (change == PlayModeStateChange.ExitingPlayMode)
{
//编辑器下退出游戏 需要把所有Stream都关了
foreach (var pair in CatAssetDatabase.GetAllBundleRuntimeInfo())
{
var info = pair.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ private struct InstantiateParam
/// </summary>
public static void Update(float deltaTime)
{
//轮询池子

foreach (var pair in PoolDict)
{
//轮询对象池
pair.Value.OnUpdate(deltaTime);
}

Expand All @@ -86,12 +87,10 @@ public static void Update(float deltaTime)
waitUnloadPrefabNames.Add(pair.Key);
}
}

foreach (string prefabName in waitUnloadPrefabNames)
{
DestroyPool(prefabName);
}

waitUnloadPrefabNames.Clear();

//处理分帧实例化
Expand Down Expand Up @@ -186,19 +185,18 @@ public static void DestroyPool(string assetName)
{
return;
}

var pool = GetOrCreatePool(prefab);
pool.OnDestroy();

PoolDict.Remove(prefab);

loadedPrefabDict.Remove(assetName);
DestroyPool(prefab);
}

/// <summary>
/// 使用模板销毁对象池
/// </summary>
public static void DestroyPool(GameObject template)
{
var pool = GetOrCreatePool(template);
pool.OnDestroy();
PoolDict.Remove(template);
}

Expand Down

0 comments on commit cbe3346

Please sign in to comment.