Implement Debug settings and provide an overview of the settings madness
This commit is contained in:
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 785995fbc50aef9057b52982d915e9e3
|
||||
Hash: 9754c7f6c4b6446b0110799319d5bcb8
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
|
||||
@@ -25,6 +25,11 @@ MonoBehaviour:
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 44f8b357e56ef9d4784ec1b1df1a13a8
|
||||
m_Address: Settings/Developer/DebugSettings
|
||||
m_ReadOnly: 0
|
||||
m_SerializedLabels: []
|
||||
FlaggedDuringContentUpdateRestriction: 0
|
||||
- m_GUID: 8f5195fb013895049a19488fd4d8f2a1
|
||||
m_Address: Settings/InteractionSettings
|
||||
m_ReadOnly: 0
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
{
|
||||
private Vector2 scrollPosition;
|
||||
private List<BaseDeveloperSettings> allDeveloperSettings = new List<BaseDeveloperSettings>();
|
||||
private string[] tabNames = new string[] { "Diving", "Other Systems" }; // Add more tabs as needed
|
||||
private string[] tabNames = new string[] { "Diving", "Debug", "Other Systems" }; // Added Debug tab
|
||||
private int selectedTab = 0;
|
||||
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
|
||||
private GUIStyle headerStyle;
|
||||
@@ -46,6 +46,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
|
||||
// If any settings are missing, create them
|
||||
CreateSettingsIfMissing<DivingDeveloperSettings>("DivingDeveloperSettings");
|
||||
CreateSettingsIfMissing<DebugSettings>("DebugSettings");
|
||||
|
||||
// Add more developer settings types here as needed
|
||||
// CreateSettingsIfMissing<OtherDeveloperSettings>("OtherDeveloperSettings");
|
||||
@@ -114,7 +115,10 @@ namespace AppleHills.Core.Settings.Editor
|
||||
case 0: // Diving
|
||||
DrawSettingsEditor<DivingDeveloperSettings>();
|
||||
break;
|
||||
case 1: // Other Systems
|
||||
case 1: // Debug
|
||||
DrawSettingsEditor<DebugSettings>();
|
||||
break;
|
||||
case 2: // Other Systems
|
||||
EditorGUILayout.HelpBox("Other developer settings will appear here as they are added.", MessageType.Info);
|
||||
break;
|
||||
// Add additional cases as more developer settings types are added
|
||||
|
||||
@@ -529,6 +529,50 @@ PrefabInstance:
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 539b408cd1191614abdcd99506f1157d, type: 3}
|
||||
--- !u!1 &327210514
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 327210516}
|
||||
- component: {fileID: 327210515}
|
||||
m_Layer: 0
|
||||
m_Name: TEST_DEBUG
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &327210515
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 327210514}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 95aaca445e0285645819c42cd00a4868, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: '::'
|
||||
--- !u!4 &327210516
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 327210514}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 4.15698, y: 1.79286, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &368640488
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3033,3 +3077,4 @@ SceneRoots:
|
||||
- {fileID: 1668240411}
|
||||
- {fileID: 1443361597}
|
||||
- {fileID: 1238302921}
|
||||
- {fileID: 327210516}
|
||||
|
||||
3
Assets/Scripts/Core/Settings/Developer.meta
Normal file
3
Assets/Scripts/Core/Settings/Developer.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5974bd02c2114bcbbbbb1b8d8f91da3c
|
||||
timeCreated: 1760102254
|
||||
62
Assets/Scripts/Core/Settings/Developer/DebugSettings.cs
Normal file
62
Assets/Scripts/Core/Settings/Developer/DebugSettings.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9fd485d4ab84bea9946425e742ccd9c
|
||||
timeCreated: 1760102133
|
||||
@@ -7,7 +7,7 @@ namespace AppleHills.Data.CardSystem
|
||||
/// Scriptable object defining a collectible card's properties.
|
||||
/// Used as a template for generating CardData instances.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "New Card", menuName = "Apple Hills/Card System/Card Definition")]
|
||||
[CreateAssetMenu(fileName = "New Card", menuName = "AppleHills/Card System/Card Definition")]
|
||||
public class CardDefinition : ScriptableObject
|
||||
{
|
||||
[Header("Identification")]
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace AppleHills.Data.CardSystem
|
||||
/// ScriptableObject containing visual configuration for card display
|
||||
/// Maps card rarities to colors and zones to colors/shapes
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "CardVisualConfig", menuName = "Apple Hills/Card System/Visual Config")]
|
||||
[CreateAssetMenu(fileName = "CardVisualConfig", menuName = "AppleHills/Card System/Visual Config")]
|
||||
public class CardVisualConfig : ScriptableObject
|
||||
{
|
||||
[Serializable]
|
||||
|
||||
@@ -8,7 +8,7 @@ using PuzzleS;
|
||||
|
||||
namespace Dialogue
|
||||
{
|
||||
[AddComponentMenu("Apple Hills/Dialogue/Dialogue Component")]
|
||||
[AddComponentMenu("AppleHills/Dialogue/Dialogue Component")]
|
||||
public class DialogueComponent : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private RuntimeDialogueGraph dialogueGraph;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Dialogue
|
||||
Typewriter // Display text one character at a time
|
||||
}
|
||||
|
||||
[AddComponentMenu("Apple Hills/Dialogue/Speech Bubble")]
|
||||
[AddComponentMenu("AppleHills/Dialogue/Speech Bubble")]
|
||||
public class SpeechBubble : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TextMeshProUGUI textDisplay;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
[CreateAssetMenu(fileName = "PickupItemData", menuName = "Game/Pickup Item Data")]
|
||||
[CreateAssetMenu(fileName = "PickupItemData", menuName = "AppleHills/Items + Puzzles/Pickup Item Data")]
|
||||
public class PickupItemData : ScriptableObject
|
||||
{
|
||||
[SerializeField] private string _itemId;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// ScriptableObject holding data for a level switch (scene name, description, icon).
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "LevelSwitchData", menuName = "Game/Level Switch Data")]
|
||||
[CreateAssetMenu(fileName = "LevelSwitchData", menuName = "AppleHills/Items & Puzzles/Level Switch Data")]
|
||||
public class LevelSwitchData : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
/// <summary>
|
||||
/// ScriptableObject representing a single puzzle step, its display info, and which steps it unlocks.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "PuzzleStepSO", menuName = "Puzzle/Step")]
|
||||
[CreateAssetMenu(fileName = "PuzzleStepSO", menuName = "AppleHills/Items & Puzzles/Step")]
|
||||
public class PuzzleStepSO : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Settings
|
||||
{
|
||||
[CreateAssetMenu(fileName = "SceneOrientationConfig", menuName = "Settings/Scene Orientation Config")]
|
||||
[CreateAssetMenu(fileName = "SceneOrientationConfig", menuName = "AppleHills/Settings/Scene Orientation Config")]
|
||||
public class SceneOrientationConfig : ScriptableObject
|
||||
{
|
||||
[System.Serializable]
|
||||
|
||||
19
Assets/Settings/Developer/DebugSettings.asset
Normal file
19
Assets/Settings/Developer/DebugSettings.asset
Normal file
@@ -0,0 +1,19 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d9fd485d4ab84bea9946425e742ccd9c, type: 3}
|
||||
m_Name: DebugSettings
|
||||
m_EditorClassIdentifier: AppleHillsScripts::AppleHills.Core.Settings.DebugSettings
|
||||
showColliders: 0
|
||||
showPerformanceStats: 0
|
||||
logLevel: 2
|
||||
godMode: 0
|
||||
timeScale: 7.09
|
||||
8
Assets/Settings/Developer/DebugSettings.asset.meta
Normal file
8
Assets/Settings/Developer/DebugSettings.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44f8b357e56ef9d4784ec1b1df1a13a8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user