Skip to content

Commit 0a76285

Browse files
Merge pull request #976 from belplaton/add-profiler-markers-for-fishnet-player-loop-events-and-subscription
feat: add profiler markers
2 parents caf94d2 + 2af2fd2 commit 0a76285

File tree

14 files changed

+1479
-981
lines changed

14 files changed

+1479
-981
lines changed

Assets/FishNet/Runtime/Generated/Component/NetworkAnimator/NetworkAnimator.cs

Lines changed: 412 additions & 353 deletions
Large diffs are not rendered by default.

Assets/FishNet/Runtime/Generated/Component/NetworkTransform/NetworkTransform.cs

Lines changed: 350 additions & 289 deletions
Large diffs are not rendered by default.

Assets/FishNet/Runtime/Generated/Component/TickSmoothing/TickSmootherController.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using FishNet.Object;
44
using GameKit.Dependencies.Utilities;
55
using UnityEngine;
6+
using Unity.Profiling;
67

78
namespace FishNet.Component.Transforming.Beta
89
{
@@ -20,6 +21,15 @@ public class TickSmootherController : IResettable
2021
#endregion
2122

2223
#region Private.
24+
25+
#region Private Profiler Markers
26+
27+
private static readonly ProfilerMarker _pm_OnUpdate = new ProfilerMarker("TickSmootherController.TimeManager_OnUpdate()");
28+
private static readonly ProfilerMarker _pm_OnPreTick = new ProfilerMarker("TickSmootherController.TimeManager_OnPreTick()");
29+
private static readonly ProfilerMarker _pm_OnPostTick = new ProfilerMarker("TickSmootherController.TimeManager_OnPostTick()");
30+
31+
#endregion
32+
2333
/// <summary>
2434
/// </summary>
2535
private InitializationSettings _initializationSettings = new();
@@ -140,21 +150,30 @@ void StopOnline()
140150

141151
public void TimeManager_OnUpdate()
142152
{
143-
UniversalSmoother.OnUpdate(Time.deltaTime);
153+
using (_pm_OnUpdate.Auto())
154+
{
155+
UniversalSmoother.OnUpdate(Time.deltaTime);
156+
}
144157
}
145158

146159
public void TimeManager_OnPreTick()
147160
{
148-
UniversalSmoother.OnPreTick();
161+
using (_pm_OnPreTick.Auto())
162+
{
163+
UniversalSmoother.OnPreTick();
164+
}
149165
}
150166

151167
/// <summary>
152168
/// Called after a tick completes.
153169
/// </summary>
154170
public void TimeManager_OnPostTick()
155171
{
156-
if (_timeManager != null)
157-
UniversalSmoother.OnPostTick(_timeManager.LocalTick);
172+
using (_pm_OnPostTick.Auto())
173+
{
174+
if (_timeManager != null)
175+
UniversalSmoother.OnPostTick(_timeManager.LocalTick);
176+
}
158177
}
159178

160179
private void PredictionManager_OnPostReplicateReplay(uint clientTick, uint serverTick)

0 commit comments

Comments
 (0)