TE6 打飞机Demo

TE6 打飞机Demo
This commit is contained in:
ALEXTANGXIAO
2025-04-26 23:23:39 +08:00
parent aaf7ddbee8
commit 1e195ed3b4
1921 changed files with 47050 additions and 44359 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>