Essential Utilities
Scripts every Unity project needs regardless of genre — singletons, object pooling, input management, scene transitions, and more.
Learning Path
Follow these steps in order to build your Essential Utilities.
Included Scripts
Generic Singleton
Thread-safe, persistent singleton base class for managers like AudioManager, GameManager, etc.
- Generic base class — inherit to make any MonoBehaviour a singleton
- Thread-safe access with lock object for multi-threaded scenarios
- Auto-creates instance if none exists in the scene
Object Pool
Generic object pooling system to reduce garbage collection. Perfect for bullets, particles, and enemies.
- Tag-based pool dictionary for multiple object types
- Automatic pool expansion when all instances are busy
- IPoolable interface for OnSpawn/OnDespawn lifecycle callbacks
Scene Manager
Async scene loading with loading screen, progress bar, and minimum load time. Clean transitions between levels.
- Async scene loading with progress callback for loading bars
- Minimum load time to prevent jarring flash-loads on fast hardware
- Loading screen GameObject toggled automatically during transitions
Input Manager
Clean wrapper around Unity's new Input System with action map switching, rebinding support, and input event bus.
- Event-driven input with OnActionPressed and OnActionReleased callbacks
- Runtime key rebinding with save/load via PlayerPrefs
- Pre-configured default actions (Jump, Sprint, Interact, Crouch, etc.)
Timer / Countdown
Versatile timer with countdown, stopwatch, and repeating modes. Formatted time display and UnityEvent callbacks.
- Three modes: Countdown, Stopwatch, and Repeating timer
- Formatted time string property (MM:SS) for direct UI display
- Normalized progress (0-1) for driving sliders and fill bars
Audio Manager
Complete audio manager with music crossfade, SFX pooling, volume control, and persistence.
- Smooth music crossfade between two AudioSource channels
- SFX object pooling with configurable pool size
- Random pitch variation on sound effects for natural audio
Screen Fader
Simple screen fade-in/fade-out with configurable color and duration. Great for scene transitions.
- Smooth alpha fade-in and fade-out with configurable duration
- FadeOutAndIn combo with callback action at the midpoint
- Configurable fade color for black, white, or custom transitions