A high-performance, purely sprite-based leaderboard system.
Important
This project is built entirely without Unity UI (Canvas), RectTransforms, or the EventSystem. It utilizes a world-space approach with SpriteRenderers, SpriteMasks, and 3D TextMeshPro, demonstrating advanced UI techniques using standard 2D/3D objects.
A high-performance, virtualized Unity leaderboard system built on the Simon core framework. This project demonstrates advanced UI techniques, including rank-change animations, data-driven layouts, and a custom dependency injection / MVC architecture.
- Virtualization Engine: Efficiently handles thousands of entries by only spawning and updating items visible in the viewport.
- Dynamic Rank Animations: Multi-phase rank-change transitions including:
- Anticipation Nudge: A subtle "wind-up" movement in the direction of the rank change.
- Smooth Interpolation: Quadratic easing for position, scale, and data (score/rank) updates.
- Slotting Effect: Other players dynamically shift to make room for the moving "me" player.
- "Sticky Me" Behavior: The player's own entry is managed persistently, ensuring it's always highlighted and correctly positioned relative to others.
- Decoupled Service Layer: Mockable leaderboard data fetching through a clean service interface.
- Dependency Injection (DI): A custom, lightweight DI container supporting
[Inject]attributes, Contexts (Project/Scene), and automated factory/pool generation. - MVC Implementation: Strict separation of concerns using
Controller,View, andModel/Statepatterns. - Signal Bus: Type-safe event system for decoupled communication between game systems.
- Object Pooling: Integrated pooling for UI elements to minimize GC allocations.
- Serialization: Simplified JSON serialization helpers for data persistence and network communication.
Simon.DI: Manages the lifecycle and dependencies of objects viaDiContainerandInstallers.Simon.MVC: Provides base classes (MvcBase,Viewer) to ensure a consistent architectural flow.Simon.Events: Handles system-wide messaging via Signals.
LeaderboardController: Coordinates the flow between data updates and the UI.LeaderboardListManager: The engine responsible for virtualization, layout calculations, and rank-change animations.LeaderboardItemViewPool: Manages the lifecycle of individual leaderboard rows.LeaderboardService: Simulates (or fetches) data updates.
- Unity 2022+: Core engine(Unity 6000.3.10).
- TextMeshPro: High-quality text rendering.
- DOTween: Powerful animation engine for UI transitions.
- Open the Scene: Navigate to
Assets/Scenes/Loader.unity. - Run: Press Play in the Unity Editor.
- Update Data: Click the Update button in the UI to simulate a rank change.
- Debug Your Rank: To test specific rank transitions:
- Select the LeaderboardUpdateButton prefab or instance in the scene.
- In the Inspector, enable Use Debug Rank.
- Set the Debug Rank value (e.g., 1 or 1000) to force the "me" player to that position on the next update.
- Observe: The "me" player will perform a complex animation to its new rank, while other items shift accordingly.
Assets/Scripts/_Simon: The core framework code.Assets/Scripts/_Game: The leaderboard application logic.Assets/Prefabs/Leaderboard: UI templates for the leaderboard and its items.Assets/Settings: Universal Render Pipeline (URP) and Project settings.
