This DI system allows to inject global and scene systems(managers) into each other.
To use this DI system you need only few things:
- Add SystemsManager prefab onto your initial scene
- Inherit your classes from SystemBase class, if you need to use them from other scripts
- Use [Inject] attribute to access these classes
- If target class is not inherited from SystemBase class, ISystem interface, or not presented on the same scene where SystemsManager prefab presented – call SystemsManager.InjectSystemsTo(this) in your Start() or Awake() method in class where you want to inject needed systems
This package contains simple example how to use Light DI:
- PlayerController with injected CameraController and InputManager.