behaviour-inject

Implements a lightweight dependency injection framework for Unity3D with runtime composition.

7|2|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/breineng/mimesis-ai-clone-unity --skill behaviour-inject
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: behaviour-inject
Source: https://github.com/breineng/mimesis-ai-clone-unity/tree/main/.agents/skills/behaviour-inject
Command: npx skills add https://github.com/breineng/mimesis-ai-clone-unity --skill behaviour-inject

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Unity projects often suffer from tangled dependencies and boilerplate wiring as game objects interact. Behaviour Inject (BInject) provides a lightweight dependency injection framework for Unity3D that enables clean, explicit wiring of dependencies and better testability.

Core Features & Use Cases

  • Field, property, and method injection via [Inject] attributes for reduced boilerplate.
  • Interface binding and automatic object composition with constructor injection.
  • Event system, commands, factories, and hierarchical contexts to manage complex game architectures.

Quick Start

Attach the Injector to a GameObject and ensure a Context is selected, then declare dependencies with the Inject attribute so they are injected automatically at runtime.

Frequently Asked Questions about behaviour-inject

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up dependency injection in Unity to reduce boilerplate wiring?

Dependency injection in Unity is set up by attaching an Injector to a GameObject, selecting a Context, and declaring dependencies with the [Inject] attribute for automatic runtime composition. This framework reduces boilerplate by supporting field, property, and method injection.

What is a DI container and how does it work in Unity game architecture?

A DI container manages explicit dependency wiring and runtime object composition in Unity game architecture. It uses interface binding and hierarchical contexts to automatically resolve and inject dependencies where needed, improving testability and reducing tangled dependencies.

Can I use constructor injection for automatic object composition in Unity?

Yes, constructor injection is supported for automatic object composition in Unity. The framework allows interface binding alongside field, property, and method injection via the [Inject] attribute to explicitly wire dependencies and manage game object interactions.

Does this Unity dependency injection framework support events and factories?

Yes, the dependency injection framework supports an event system, commands, and factories. These features operate within hierarchical contexts to help manage complex game architectures and runtime composition effectively.

When do I need hierarchical contexts for dependency injection in game development?

Hierarchical contexts are needed when managing complex game architectures that require varied dependency scopes and runtime composition. They organize explicit dependency wiring, events, and factories to cleanly separate different gameplay systems and object lifecycles.

What is the best way to untangle dependencies and improve testability in Unity3D?

The best way to untangle dependencies in Unity3D is using a lightweight dependency injection framework with explicit wiring. By applying [Inject] attributes and hierarchical contexts, you achieve automatic object composition and better testability without heavy boilerplate.