添加Tracy0.11的性能分析支持
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user