添加Tracy0.11的性能分析支持

This commit is contained in:
2025-11-27 17:18:30 +08:00
parent 92c5c7f795
commit 0d856db69a
56 changed files with 4045 additions and 505 deletions

View File

@@ -1,10 +1,8 @@
using Convention;
using Demo.Editor.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Convention;
using Demo.Editor.UI;
using UnityEngine;
namespace Demo.Game
@@ -71,38 +69,41 @@ namespace Demo.Game
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
{
base.UpdateTicks(currentTime, deltaTime, tickType);
float GetPercentValue()
using (Profiler.BeginZone($"Updatement<{typeof(DataType).Name}>.UpdateTicks"))
{
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
}
base.UpdateTicks(currentTime, deltaTime, tickType);
if (Entries.Count <= 1)
return;
switch (tickType)
{
case TickType.Reset:
case TickType.Start:
{
Content = 0;
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
float GetPercentValue()
{
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
}
if (Entries.Count <= 1)
return;
switch (tickType)
{
case TickType.Reset:
case TickType.Start:
{
Content = 0;
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
Content++;
UpdateEntry(Content, GetPercentValue());
}
break;
default:
if (Entries[0].TimePoint > currentTime)
return;
if (Content + 1 >= Entries.Count)
return;
if (Entries[Content + 1].TimePoint < currentTime)
Content++;
UpdateEntry(Content, GetPercentValue());
}
break;
default:
if (Entries[0].TimePoint > currentTime)
return;
if (Content + 1 >= Entries.Count)
return;
if (Entries[Content + 1].TimePoint < currentTime)
Content++;
if (Content + 1 >= Entries.Count)
UpdateEntry(Content, 1);
else
UpdateEntry(Content, GetPercentValue());
break;
if (Content + 1 >= Entries.Count)
UpdateEntry(Content, 1);
else
UpdateEntry(Content, GetPercentValue());
break;
}
}
}