From 4ea7eb9aeac17fcbb696b9e62b8d986d78aba27c Mon Sep 17 00:00:00 2001 From: Brajan Bartoszewicz Date: Mon, 26 May 2025 17:40:27 +0200 Subject: [PATCH] debug overlay mode is hidden by default --- Editor/Build/BuildVersionBumper.cs | 6 +- .../Services/Development/DevToolsService.cs | 99 +++++++++---------- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/Editor/Build/BuildVersionBumper.cs b/Editor/Build/BuildVersionBumper.cs index da911d2..6f09edb 100755 --- a/Editor/Build/BuildVersionBumper.cs +++ b/Editor/Build/BuildVersionBumper.cs @@ -55,9 +55,9 @@ namespace RebootKitEditor.Build { } static bool TryParseVersion(string version, out int major, out int minor, out int patch) { - major = 0; - minor = 0; - patch = 0; + major = -1; + minor = -1; + patch = -1; string[] parts = version.Split('.'); if (parts.Length != 3) { diff --git a/Runtime/Engine/Code/Services/Development/DevToolsService.cs b/Runtime/Engine/Code/Services/Development/DevToolsService.cs index fffb8e8..8b8a0d4 100755 --- a/Runtime/Engine/Code/Services/Development/DevToolsService.cs +++ b/Runtime/Engine/Code/Services/Development/DevToolsService.cs @@ -1,51 +1,50 @@ -using System; -using RebootKit.Engine.Foundation; -using RebootKit.Engine.Services.Console; -using UnityEngine; -using UnityEngine.InputSystem; - -namespace RebootKit.Engine.Services.Development { - static class DebugConfig { - [ConfigVar("debug.overlay", 1, "Controls overlay visibility. 0 - hidden, 1 - visible")] public static ConfigVar s_OverlayMode; - } - - public class DevToolsService : ServiceMonoBehaviour { - [SerializeField] DebugOverlayView m_DebugOverlayView; - - - IDisposable m_CVarChangedListener; - - void Start() { - ConfigVar.StateChanged += OnCVarChanged; - // OnOverlayModeChanged(m_OverlayMode.IndexValue); - } - - void OnDisable() { - Dispose(); - } - - public override void Dispose() { - ConfigVar.StateChanged -= OnCVarChanged; - } - - void Update() { - if (InputSystem.GetDevice().f3Key.wasReleasedThisFrame) { - DebugConfig.s_OverlayMode.Set(DebugConfig.s_OverlayMode.IndexValue == 1 ? 0 : 1); - } - } - - void OnOverlayModeChanged(int mode) { - if (mode == 1) { - m_DebugOverlayView.gameObject.SetActive(true); - } else { - m_DebugOverlayView.gameObject.SetActive(false); - } - } - - void OnCVarChanged(ConfigVar cvar) { - if (cvar == DebugConfig.s_OverlayMode) { - OnOverlayModeChanged(cvar.IndexValue); - } - } - } +using System; +using RebootKit.Engine.Foundation; +using RebootKit.Engine.Services.Console; +using UnityEngine; +using UnityEngine.InputSystem; + +namespace RebootKit.Engine.Services.Development { + static class DebugConfig { + [ConfigVar("debug.overlay", 0, "Controls overlay visibility. 0 - hidden, 1 - visible")] public static ConfigVar s_OverlayMode; + } + + public class DevToolsService : ServiceMonoBehaviour { + [SerializeField] DebugOverlayView m_DebugOverlayView; + + IDisposable m_CVarChangedListener; + + void Start() { + ConfigVar.StateChanged += OnCVarChanged; + OnCVarChanged(DebugConfig.s_OverlayMode); + } + + void OnDisable() { + Dispose(); + } + + public override void Dispose() { + ConfigVar.StateChanged -= OnCVarChanged; + } + + void Update() { + if (InputSystem.GetDevice().f3Key.wasReleasedThisFrame) { + DebugConfig.s_OverlayMode.Set(DebugConfig.s_OverlayMode.IndexValue == 1 ? 0 : 1); + } + } + + void OnOverlayModeChanged(int mode) { + if (mode == 1) { + m_DebugOverlayView.gameObject.SetActive(true); + } else { + m_DebugOverlayView.gameObject.SetActive(false); + } + } + + void OnCVarChanged(ConfigVar cvar) { + if (cvar == DebugConfig.s_OverlayMode) { + OnOverlayModeChanged(cvar.IndexValue); + } + } + } } \ No newline at end of file