mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
col
This commit is contained in:
parent
bce7d144f0
commit
a8b075ddd3
@ -1697,7 +1697,7 @@ public static void OnGUI()
|
||||
GUILayout.BeginHorizontal("Box");
|
||||
GUILayout.Label("Snapshot Interp.:");
|
||||
// color code the current snapshot interpolation mode.
|
||||
GUI.color = SnapshotModeUtils.ColorCode(snapshotMode);
|
||||
GUI.color = SnapshotModeUtils.ColorCode(snapshotMode, Color.white);
|
||||
GUILayout.Box($"timeline: {localTimeline:F2}");
|
||||
GUILayout.Box($"buffer: {snapshots.Count}");
|
||||
GUILayout.Box($"mode: {snapshotMode}");
|
||||
|
@ -16,18 +16,18 @@ public enum SnapshotMode
|
||||
|
||||
public static class SnapshotModeUtils
|
||||
{
|
||||
public static Color ColorCode(SnapshotMode mode)
|
||||
public static Color ColorCode(SnapshotMode mode, Color defaultColor)
|
||||
{
|
||||
// color code the current snapshot interpolation mode.
|
||||
// colors comparable to temperature. red=hot/fast, blue=cold/slow.
|
||||
switch (mode)
|
||||
{
|
||||
case SnapshotMode.Normal: return Color.white;
|
||||
case SnapshotMode.Normal: return defaultColor;
|
||||
case SnapshotMode.Catchup: return Color.yellow;
|
||||
case SnapshotMode.ClampBehind: return Color.red;
|
||||
case SnapshotMode.Slowdown: return Color.cyan;
|
||||
case SnapshotMode.ClampAhead: return Color.blue;
|
||||
default: return Color.white;
|
||||
default: return defaultColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ out double t
|
||||
accumulatedDeltaTime = 0;
|
||||
|
||||
// color material while catching up / slowing down
|
||||
render.material.color = SnapshotModeUtils.ColorCode(mode);
|
||||
render.material.color = SnapshotModeUtils.ColorCode(mode, Color.black);
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
|
Loading…
Reference in New Issue
Block a user