Implement Debug settings and provide an overview of the settings madness

This commit is contained in:
Michal Pikulski
2025-10-10 15:47:38 +02:00
parent 73b4ea919b
commit 81a6becd44
30 changed files with 558 additions and 11 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5974bd02c2114bcbbbbb1b8d8f91da3c
timeCreated: 1760102254

View File

@@ -0,0 +1,62 @@
using UnityEngine;
namespace AppleHills.Core.Settings
{
/// <summary>
/// Enum defining log verbosity levels
/// </summary>
public enum LogVerbosity
{
None = 0,
Errors = 1,
Warnings = 2,
Info = 3,
Verbose = 4
}
/// <summary>
/// Developer settings for debugging features and options.
/// These settings are meant to be used during development and testing.
/// </summary>
[CreateAssetMenu(fileName = "DebugSettings", menuName = "AppleHills/Developer Settings/Debug", order = 2)]
public class DebugSettings : BaseDeveloperSettings
{
[Header("Visualization")]
[Tooltip("Show colliders for game objects")]
[SerializeField] private bool showColliders = false;
[Tooltip("Show performance statistics (FPS, memory usage, etc.)")]
[SerializeField] private bool showPerformanceStats = false;
[Header("Logging")]
[Tooltip("Level of detail for logging")]
[SerializeField] private LogVerbosity logLevel = LogVerbosity.Warnings;
[Header("Gameplay")]
[Tooltip("Make player invulnerable and ignore gameplay restrictions")]
[SerializeField] private bool godMode = false;
[Tooltip("Global time scale for debugging animations and effects")]
[Range(0.1f, 10f)]
[SerializeField] private float timeScale = 1.0f;
// Property getters
public bool ShowColliders => showColliders;
public bool ShowPerformanceStats => showPerformanceStats;
public LogVerbosity LogLevel => logLevel;
public bool GodMode => godMode;
public float TimeScale => timeScale;
public override void OnValidate()
{
base.OnValidate();
// Apply any immediate effects when values change in the editor
if (Application.isPlaying)
{
// Set time scale directly when changed in editor
Time.timeScale = timeScale;
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d9fd485d4ab84bea9946425e742ccd9c
timeCreated: 1760102133