This commit is contained in:
2025-05-14 10:52:53 +02:00
parent 1e190fe94b
commit f0536f4129
51 changed files with 934 additions and 381 deletions

View File

@@ -1,4 +1,5 @@
using System;
using RebootKit.Engine.Main;
using RebootKit.Engine.UI;
using UnityEngine;
using UnityEngine.UIElements;
@@ -10,13 +11,18 @@ namespace RebootKit.Engine.Services.Development {
VisualElement m_RootElement;
Label m_FPSLabel;
Label m_GameModeLabel;
void Update() {
if (m_RootElement == null) {
return;
}
m_FPSLabel.text = $"fps: {Mathf.RoundToInt(1f / Time.deltaTime)} | dt: {Time.deltaTime:F4}ms | runtime: {Time.time:F4}s";
Resolution resolution = Screen.currentResolution;
m_FPSLabel.text = $"fps: {Mathf.RoundToInt(1f / Time.deltaTime)} | dt: {Time.deltaTime:F4}ms | runtime: {Time.time:F4}s | resolution: {resolution.width}x{resolution.height}@{resolution.refreshRateRatio}Hz";
m_GameModeLabel.text = RR.GameModes.ActiveGameMode.CurrentValue != null
? $"Game Mode: {RR.GameModes.ActiveGameMode.CurrentValue.GetType().Name}"
: "Game Mode: none";
}
public override VisualElement Build() {
@@ -24,7 +30,8 @@ namespace RebootKit.Engine.Services.Development {
CreateLabel($"Toggle Overlay [F3] | RebootKit | game: {Application.productName}, version: {Application.version}");
m_FPSLabel = CreateLabel($"FPS: {Application.targetFrameRate}");
m_GameModeLabel = CreateLabel("Game Mode: none");
return m_RootElement;
}