unity-dependency-injection

Installation
SKILL.md

Unity Dependency Injection (DI)

A lightweight system to satisfy the "D" in SOLID. Allows classes to request dependencies via [Inject] without knowing who provides them.

Core Features

  1. Attribute-Based Injection: Use [Inject] to mark fields and [Provide] to define sources.
  2. Interface Focus: Encourages programming to abstractions, making systems hot-swappable.
  3. Automated Wiring: Scene-wide injection happens on Awake, ensuring dependencies are ready before Start.
  4. Diagnostic Logging: Tracks successful injections and warns about missing providers.

Core Files (Max 3)

  • DIAttributes.cs.txt: Contains the marker attributes for the compiler.
  • DependencyInjector.cs.txt: The engine that finds and wires dependencies in the scene.
  • DIExample.cs.txt: Shows how to decouple a Hero from an AbilitySystem.

Usage

Installs
21
GitHub Stars
9
First Seen
Apr 19, 2026
unity-dependency-injection — muharremtozan/unity-agent-skills