Cleanup compile warnings, cleanup logs, spruce up level selection menu

This commit is contained in:
Michal Pikulski
2025-10-28 14:31:17 +01:00
parent a5b1a4f8a0
commit 43779c560e
67 changed files with 4814 additions and 1050 deletions

View File

@@ -2,14 +2,13 @@
using System.IO;
using System.Linq;
using AppleHills.Data.CardSystem;
using UnityEditor;
using UnityEditor.AddressableAssets.Settings;
using UnityEngine;
using UnityEngine.UI;
using AppleHills.Editor.Utilities;
using UI.CardSystem;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
namespace AppleHills.Editor.CardSystem
namespace Editor.CardSystem
{
/// <summary>
/// Editor utility for managing card definitions without directly editing scriptable objects.
@@ -45,11 +44,8 @@ namespace AppleHills.Editor.CardSystem
private bool _previewNeedsUpdate = true;
// Preview settings
private float _previewZoom = 1.0f;
private Vector2 _previewOffset = Vector2.zero;
private bool _debugMode = false;
private float _zoomMultiplier = 1.5f; // Default multiplier (no zoom)
private const float DEFAULT_ZOOM = 1.5f; // Store default zoom as a constant
private const float BASE_ORTHO_SIZE = 400.0f; // Increased from 0.8f to 8.0f for a much wider view
// PreviewRenderUtility for rendering the card in a hidden scene

View File

@@ -139,7 +139,7 @@ namespace AppleHills.Editor.PuzzleSystem
// Apply any pending changes
if (_isDirty)
{
SaveChanges();
SavePuzzleChanges();
_isDirty = false;
}
}
@@ -686,7 +686,7 @@ namespace AppleHills.Editor.PuzzleSystem
_isDirty = false;
}
private void SaveChanges()
private void SavePuzzleChanges()
{
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
@@ -782,7 +782,7 @@ namespace AppleHills.Editor.PuzzleSystem
if (!_isPlaying) return;
// Find PuzzleManager instance
PuzzleManager puzzleManager = Object.FindObjectOfType<PuzzleManager>();
PuzzleManager puzzleManager = Object.FindFirstObjectByType<PuzzleManager>();
if (puzzleManager == null)
{
@@ -816,7 +816,7 @@ namespace AppleHills.Editor.PuzzleSystem
{
if (!_isPlaying || step == null) return;
PuzzleManager puzzleManager = Object.FindObjectOfType<PuzzleManager>();
PuzzleManager puzzleManager = Object.FindFirstObjectByType<PuzzleManager>();
if (puzzleManager == null) return;
// Get current unlock state
@@ -860,7 +860,7 @@ namespace AppleHills.Editor.PuzzleSystem
{
if (!_isPlaying || step == null) return;
PuzzleManager puzzleManager = Object.FindObjectOfType<PuzzleManager>();
PuzzleManager puzzleManager = Object.FindFirstObjectByType<PuzzleManager>();
if (puzzleManager == null) return;
// Complete the step

View File

@@ -1,6 +1,8 @@
using UnityEditor;
using AppleHills.Core.Settings;
using Core;
using UnityEngine;
using UnityEngine.Rendering.VirtualTexturing;
namespace AppleHills.Editor
{
@@ -63,7 +65,7 @@ namespace AppleHills.Editor
GetPuzzlePromptRange
);
Debug.Log("Editor settings loaded for Scene View use");
LogDebugMessage("Editor settings loaded for Scene View use");
}
public static void RefreshSceneViews()
@@ -100,5 +102,14 @@ namespace AppleHills.Editor
return null;
}
private static void LogDebugMessage(string message)
{
if (Application.isPlaying &&
DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().settingsLogVerbosity <= LogVerbosity.Debug)
{
Logging.Debug($"[EditorSettingsProvider] {message}");
}
}
}
}