SI
SinlessDevil/ZenjectTemplate
Modular Zenject-based Unity template with built-in architecture, services, โ ready for mid-core or hybrid-casual projects.
๐งฉ Unity Zenject Template
A clean, modular Unity template built on Zenject, designed for scalable game projects. Includes core services, state machine, tool integrations, URP setup, and a full test suite.
โจ Features
- ๐ง State Machine (Game Flow) โ
Bootstrap โ Load โ Menu โ Game โ Win/Lose - ๐๏ธ Factory Services โ UI, Game, Widget, and Scene instantiation
- ๐ Static Data System โ Loadable config data for sounds, levels, etc.
- ๐ฆ Save System Toolkit โ PlayerPrefs / JSON / XML + Editor tool
- ๐ Audio & Vibration Kit โ Music, 2D/3D sounds, haptics with pooling
- ๐งช Built-in Test ToolKit โ Scene/prefab/enum/guid validation
- ๐จ URP + Toony Colors Pro โ Stylized rendering preset
- ๐ SRDebugger โ Integrated in-game debug UI
- ๐ Modular Structure โ Clean separation into Code, Plugins, Tests, Resources
๐งช Test Coverage
EditMode:
GuidDuplicationTestโ detects duplicate.metaGUIDsResourcesPrefabValidationTestsโ checks for missing scripts inResourcesprefabsSceneValidationTestsโ verifies scenes for:- missing scripts
- missing prefab links
- null fields on serializable components
Enum Testsโ ensures enum-to-data mapping is validLevelService Testsโ validates level selection and local progress logicStorageService Testsโ checks key-value consistency
PlayMode:
WidgetProvider Testsโ tests prefab resolution and instantiation
๐ฆ Included Tools
โ Entry Point
The BootstrapInstaller (via Zenject) wires up:
- Core services (UI, Level, SaveLoad, Storage, Audio)
- Game StateMachine & States
- Static Data loaders
- Coroutine runner and loading curtain
๐ Architecture Overview
The project is structured with a modular architecture, using Zenject as the Dependency Injection framework. It is designed to support mid-core and hybrid-casual projects out of the box. Below is an overview of the core systems and services:
๐ Core Components
- ๐ Game State Machine
A flexible state machine with separate classes for each game state:BootstrapState,LoadProgressState,LoadMenuState,LoadLevelState,GameLoopState, etc.
- ๐ Game/UI Factories
Centralized services for creating gameplay entities and UI windows. - ๐ Static Data System
Configurable data loading system using ScriptableObjects. Includes support for gameplay configuration and audio/vibration settings. - ๐ง Services Layer
Decoupled services for all game-related logic:- Level Management (LevelService)
- Save/Load Progress (UnifiedSaveLoadFacade)
- UI & Windows (WindowService)
- Input Handling (InputService)
- Random Generator (RandomService)
- Time Management (TimeService)
- Widget System (WidgetProvider)
- Storage Logic (StorageService)
- ๐ฎ Win/Lose System
IncludesWinServiceandLoseServicefor handling end-of-level logic. - ๐ช Coroutine and Loading Curtain
Mono-based services used for async logic and visual transitions.
On this page
Languages
C#87.2%ShaderLab9.2%HLSL1.4%C0.7%C++0.7%CMake0.7%
Contributors
Created March 9, 2025
Updated February 7, 2026