ZenjectTemplate
Modular Zenject-based Unity template with built-in architecture, services, — ready for mid-core or hybrid-casual projects.
Install / Use
/learn @SinlessDevil/ZenjectTemplateREADME
🧩 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
Includes
WinServiceandLoseServicefor handling end-of-level logic. - 🚪 Coroutine and Loading Curtain Mono-based services used for async logic and visual transitions.
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
