/MinJect

A minimalistic, easy-to-understand dependency injection framework for Unity.

Primary LanguageC#MIT LicenseMIT


MinJect

GitHub tag (latest SemVer) GitHub repo size GitHub Repo stars

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contact

About The Project

MinJect is a simple dependency injection framework, forked from a now-defunct repo from Wooga. It focuses on being minimalistic and easy to use.

Getting Started

Import the package into your project. If you want to get acquainted with the code, take a look at the Injector class, more specifically the InjectDependenciesOf method. Next, take a look at the InjectField attribute.

To inject dependencies into a class, simply mark the injectable fields with the [InjectableField] attribute, and then call injector.InjectDependenciesOf(instanceOfClass).

The package also includes a number of unit tests written using FluentAssertions for maximum readability. They may also be useful in understanding how the framework functions.

Installation

  1. Open the package manager.
  2. Click on the plus icon on the top left corner, and select 'Add package from git URL'.
  3. Paste in 'https://github.com/ninito-ph/MinJect.git'.
  4. Import it into your project!

Contact

Paulo Oliveira - paulo at ninito dot me

Project Link: https://github.com/ninito-ph/MinJect