TEngine 6

This commit is contained in:
Alex-Rachel
2025-03-07 23:09:46 +08:00
parent aad8ff3ee5
commit 551727687f
1988 changed files with 46223 additions and 94880 deletions

View File

@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace YooAsset.Editor
{
internal class RemotePlayerSession
{
private readonly List<DebugReport> _reportList = new List<DebugReport>();
private readonly Queue<DebugReport> _reports = new Queue<DebugReport>();
/// <summary>
/// 用户ID
@@ -29,7 +30,7 @@ namespace YooAsset.Editor
{
get
{
int index = _reportList.Count - 1;
int index = _reports.Count - 1;
if (index < 0)
index = 0;
return index;
@@ -37,7 +38,7 @@ namespace YooAsset.Editor
}
public RemotePlayerSession(int playerId, int maxReportCount = 1000)
public RemotePlayerSession(int playerId, int maxReportCount = 500)
{
PlayerId = playerId;
MaxReportCount = maxReportCount;
@@ -48,7 +49,7 @@ namespace YooAsset.Editor
/// </summary>
public void ClearDebugReport()
{
_reportList.Clear();
_reports.Clear();
}
/// <summary>
@@ -59,9 +60,9 @@ namespace YooAsset.Editor
if (report == null)
Debug.LogWarning("Invalid debug report data !");
if (_reportList.Count >= MaxReportCount)
_reportList.RemoveAt(0);
_reportList.Add(report);
if (_reports.Count >= MaxReportCount)
_reports.Dequeue();
_reports.Enqueue(report);
}
/// <summary>
@@ -69,11 +70,11 @@ namespace YooAsset.Editor
/// </summary>
public DebugReport GetDebugReport(int rangeIndex)
{
if (_reportList.Count == 0)
if (_reports.Count == 0)
return null;
if (rangeIndex < 0 || rangeIndex >= _reportList.Count)
if (rangeIndex < 0 || rangeIndex >= _reports.Count)
return null;
return _reportList[rangeIndex];
return _reports.ElementAt(rangeIndex);
}
/// <summary>