Archived on 2026-10-24. This is a historical implementation note, not current setup instructions or an active task list. Original claims, code examples, file paths, and completion statements have not all been revalidated. Use the current documentation and issue register for maintenance decisions.
UI File Reorganization Summary¶
Date¶
December 29, 2025
Overview¶
Reorganized UI files from feature-based structure (Achievement/, Collection/, Shop/) to type-based structure (Controllers/, Views/, Buttons/, Shared/). Removed old Panel.cs script and integrated its logic into Page and MenuController.
New Folder Structure¶
Assets/Script/App/UI/¶
├── Controllers/ # All UI controller scripts
├── Views/ # All UI view scripts
├── Buttons/ # All UI button scripts
└── Shared/ # Shared UI components
Assets/Script/App/Misc/¶
└── Misc/ # Miscellaneous UI-related scripts
Files Moved¶
Controllers (→ Assets/Script/App/UI/Controllers/)¶
AchievementUIController.cs(from Mainmenu/Achievement/)CharacterSelectionUIController.cs(from Mainmenu/)CollectionUIController.cs(from Mainmenu/Collection/)LeaderboardUIController.cs(from Mainmenu/)MenuController.cs(from Core/)ShopUIController.cs(from Mainmenu/Shop/)
Views (→ Assets/Script/App/UI/Views/)¶
AchievementCardView.cs(from Mainmenu/Achievement/)AchievementView.cs(from Mainmenu/Achievement/)CollectionButtonView.cs(from Mainmenu/Collection/)CollectionView.cs(from Mainmenu/Collection/)MenuView.cs(from Mainmenu/)ShopButtonView.cs(from Mainmenu/Shop/)ShopView.cs(from Mainmenu/Shop/)
Buttons (→ Assets/Script/App/UI/Buttons/)¶
CollectionButton.cs(from Mainmenu/Collection/)LeaderboardButton.cs(from Mainmenu/)LevelSelectButton.cs(from Mainmenu/)ShopButton.cs(from Mainmenu/Shop/)
Shared Components (→ Assets/Script/App/UI/Shared/)¶
Page.cs(from Mainmenu/) - Updated with IsRootPage propertyAutoScrollNavigation.cs(from Mainmenu/)TabsManager.cs(from Mainmenu/)Tooltip.cs(from Mainmenu/)TooltipSystem.cs(from Mainmenu/)TooltipTrigger.cs(from Mainmenu/)TooltipTrigger_AchievementLock.cs(from Mainmenu/)TooltipTrigger_AchievementReward.cs(from Mainmenu/)TooltipTrigger_Button.cs(from Mainmenu/)VersionListButton.cs(from Mainmenu/)- NEW:
GamePanel.cs- Replacement for Panel.cs in game contexts
Misc (→ Assets/Script/App/Misc/)¶
ChangeLogReader.cs(from Mainmenu/)Statistic.cs(from Mainmenu/)
Files Deleted¶
Assets/Script/App/UI/Mainmenu/Panel.csAssets/Script/App/UI/Mainmenu/Panel.cs.metaAssets/Script/App/UI/Mainmenu/Achievement/(entire folder)Assets/Script/App/UI/Mainmenu/Collection/(entire folder)Assets/Script/App/UI/Mainmenu/Shop/(entire folder)Assets/Script/App/UI/Mainmenu.meta(folder meta)
Code Changes¶
1. Page.cs¶
Added: IsRootPage property to identify root pages
public bool IsRootPage = false;
2. MenuController.cs¶
Changes:
- Moved from Core/ to UI/Controllers/
- Added UpdateBackQuitText() method to handle back/quit button logic
- Updated PopPage() to call UpdateBackQuitText()
- Updated Start() to call UpdateBackQuitText() instead of separate string refresh calls
Back/Quit Logic: - Shows "Quit" when on root page (stack count == 1 or IsRootPage == true) - Shows "Back" when navigating deeper in the menu
3. MenuView.cs¶
Changes:
- Removed redundant LocalizedString references (now handled by MenuController)
- Simplified OnPagePopped() method with comment explaining back/quit text is handled by MenuController
- Removed Unity.Localization import (no longer needed)
4. GameMenuManager.cs¶
Changes:
- Updated all Panel references to GamePanel
- Updated Panel.PanelType enum references to GamePanel.GamePanelType
- Updated method signatures:
- OpenPanel(Panel panel) → OpenPanel(GamePanel panel)
- ClosePanel(Panel panel) → ClosePanel(GamePanel panel)
5. TutorialManager.cs¶
Changes:
- Updated all Panel references to GamePanel
- Updated Panel.PanelType enum references to GamePanel.GamePanelType
- Updated method signatures:
- OpenPanel(Panel panel) → OpenPanel(GamePanel panel)
- ClosePanel(Panel panel) → ClosePanel(GamePanel panel)
6. GamePanel.cs (NEW)¶
Purpose: Replacement for Panel.cs in in-game contexts
Contains:
- panelName field with GamePanelType enum
- isMainPanel boolean
- firstSelected GameObject reference
- Same enum values as original PanelType for compatibility
Architecture Improvements¶
Separation of Concerns¶
- Controllers - Handle UI logic and data management
- Views - Handle UI display and user interaction
- Buttons - Handle button-specific behavior
- Shared - Reusable UI components
Panel Logic Consolidation¶
- Main Menu Navigation: Uses Page system with MenuController
- Page.cs handles animations and element management
- MenuController handles page stack and transitions
-
Back/Quit logic based on page stack state
-
In-Game Menus: Uses GamePanel system
- GameMenuManager handles in-game pause/settings menus
- TutorialManager handles tutorial UI panels
- GamePanel replaces old Panel.cs for in-game contexts
Benefits¶
- Better Organization: Files grouped by type rather than feature
- Easier Navigation: Clear separation between controllers, views, and buttons
- Reduced Duplication: Shared components in one location
- Clearer Architecture: MVC-like structure with Controllers, Views, and Buttons
- Back/Quit Logic Simplification: Logic centralized in MenuController
- Maintainability: Easier to find and update related files
Migration Notes¶
For Developers¶
- Finding Files: Look in type-based folders rather than feature folders
- Controllers:
Assets/Script/App/UI/Controllers/ - Views:
Assets/Script/App/UI/Views/ - Buttons:
Assets/Script/App/UI/Buttons/ -
Shared:
Assets/Script/App/UI/Shared/ -
Creating New UI Features:
- Controller logic →
Controllers/YourFeatureController.cs - View logic →
Views/YourFeatureView.cs -
Button logic →
Buttons/YourFeatureButton.cs -
Using Page System:
- Set
IsRootPage = trueon main menu pages -
MenuController automatically handles back/quit text
-
Using GamePanel System:
- For in-game pause/settings menus
- Use
GamePanel.GamePanelTypeenum for panel identification
Testing Checklist¶
- [ ] Main menu navigation works correctly
- [ ] Back button shows "Back" when not on root page
- [ ] Back button shows "Quit" when on root page
- [ ] All sub-pages (Shop, Collection, Achievement, etc.) navigate correctly
- [ ] In-game pause menu works correctly
- [ ] Tutorial UI panels work correctly
- [ ] No broken references in Unity scenes
- [ ] All scripts compile without errors
Future Considerations¶
- Consider renaming
Misc/folder to better describe its contents - Consider moving
GamePanel.csto a more appropriate location if needed - Document best practices for creating new UI features
- Consider adding namespaces to prevent conflicts