working on actors

This commit is contained in:
2025-07-03 05:52:25 +02:00
parent dca9f8883a
commit c39b87ed44
16 changed files with 975 additions and 165 deletions

View File

@@ -1,5 +1,8 @@
using RebootKit.Engine.Main;
using System.Text;
using RebootKit.Engine.Main;
using RebootKit.Engine.UI;
using Unity.Netcode;
using Unity.Netcode.Transports.UTP;
using UnityEngine;
using UnityEngine.UIElements;
@@ -10,6 +13,7 @@ namespace RebootKit.Engine.Services.Development {
VisualElement m_RootElement;
Label m_FPSLabel;
Label m_NetworkStatsLabel;
void Update() {
if (m_RootElement == null) {
@@ -18,6 +22,17 @@ namespace RebootKit.Engine.Services.Development {
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";
NetworkManager nm = NetworkManager.Singleton;
StringBuilder sb = new StringBuilder();
sb.Append("Network: ");
sb.Append($"IsServer: {nm.IsServer}");
sb.Append($" | IsClient: {nm.IsClient}");
sb.Append($" | IsHost: {nm.IsHost}");
m_NetworkStatsLabel.text = sb.ToString();
}
public override VisualElement Build() {
@@ -26,6 +41,8 @@ namespace RebootKit.Engine.Services.Development {
CreateLabel($"Toggle Overlay [F3] | RebootKit | game: {Application.productName}, version: {Application.version}");
m_FPSLabel = CreateLabel($"FPS: {Application.targetFrameRate}");
m_NetworkStatsLabel = CreateLabel("Network Stats");
return m_RootElement;
}