This commit is contained in:
vis2k 2023-03-16 15:53:24 +08:00
parent bce7d144f0
commit a8b075ddd3
3 changed files with 5 additions and 5 deletions

View File

@ -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}");

View File

@ -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;
}
}
}

View File

@ -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()