Fix singleton replacement logic and add debug logging for moves#3
Open
ehalsey wants to merge 6 commits intoRimaethon:masterfrom
Open
Fix singleton replacement logic and add debug logging for moves#3ehalsey wants to merge 6 commits intoRimaethon:masterfrom
ehalsey wants to merge 6 commits intoRimaethon:masterfrom
Conversation
This commit addresses critical runtime errors preventing the game from starting and functioning properly. The main issues were singleton initialization order problems and missing AudioManager null checks. Key Changes: - Created ManagerBootstrap.cs to auto-initialize EventManager, SceneController, and EventSystem with proper InputSystemUIInputModule configuration before scene load - Fixed InputSystemUIInputModule not tracking input by calling AssignDefaultActions() - Added null checks for EventManager.Instance in OnEnable() methods across 9 UI components to prevent crashes when singletons aren't ready yet - Added comprehensive AudioManager.Instance null checks (14 locations) to allow game to run without sound until AudioManager is properly configured - Fixed AWS initialization exception handling in RemoteContentManager - Fixed null reference errors in InputManager, TimeManager callbacks - Created diagnostic utilities: * ClickDebugger.cs - Comprehensive UI input debugging tool * FixCanvasCameras.cs - Auto-assigns Main Camera to ScreenSpaceCamera canvases Files Modified: - Core: InputHandler.cs, MatchHandler.cs - Managers: EventManager.cs, SaveManager.cs, SceneController.cs, TimeManager.cs, RemoteContentManager.cs, PostProcessingManager.cs - UI: UIButton.cs, MainMenuUIManager.cs, LevelPanel.cs, EventButton.cs, StarResourceBar.cs, HeartResourceBar.cs, CoinResourceBar.cs, FortuneWheelEvent.cs - Items: GeneratorItem.cs, TNTBooster.cs, HorizontalRocketBooster.cs, VerticalRocketBooster.cs, StoneObstacleBoardItem.cs, LightGrassUnderLayBoardItem.cs, DarkGrassUnderlayBoardItem.cs - Input: InputManager.cs Result: Game now starts successfully, UI buttons work, gem swapping and matching functions properly. Game runs without crashes but without sound until AudioManager is configured in scenes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Change button click check from isActiveAndEnabled to interactable - Force all UIButtons to be interactable on Awake - Move LevelCreator to Editor folder (build compilation fix) - Add comprehensive diagnostic logging for button clicks - Add BoardSpriteSaveData editor-only preprocessor directives - Switch scripting backend to Mono (IL2CPP not installed) Issue: SaveManager file paths still need fixing for standalone builds
Fixed multiple issues to create a playable standalone Windows build: - Build system now uses Mono2x backend to avoid IL2CPP installation requirement - File paths updated to use StreamingAssets and persistentDataPath for builds - Editor-only code separated with preprocessor directives - Scene loading starts on MainMenuScene instead of auto-loading gameplay - Camera and UI scaling adjusted so all 10 gem rows are visible with top/bottom panels - Gems scaled to 2x individually for better visibility and proper grid alignment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix grass sprite scaling: Changed spritePixelsToUnits from 950/975 to 530 to match gem size - Restore SceneController auto-load of MainMenuScene (scene 1) on startup - Fix BoardSpriteSaveData preprocessor directive syntax error - Fix TNTRocketMergeAction crash: Add AudioManager null checks - Fix ProgressBarPanel crash: Add _eventData null check in GetRemainingTime - Camera orthographic size: 6 (provides proper UI spacing) These fixes resolve: - Game not displaying main menu on startup - Grass blocks appearing too small relative to gems - Game freezing when combining TNT + Rocket boosters - ProgressBarPanel crash during time updates
- Add null checks in TopLayerCanvasManager to prevent crash when level completes - Fix grass sprite scaling (LightGrass/DarkGrass to 2200 to account for 2x image size) - Fix mailbox sprite scaling (550 to 1100 to match stone blocks) - Adjust board position for better centering (x: -0.3 to -0.6, y: -4.5 to -4.2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix StaticInstance to destroy old singleton instance instead of new one, ensuring scene transitions properly replace managers - Add debug logging to InputHandler for move count changes to aid debugging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code