Description
In this course, you will learn :
- Using the Zenject Framework, you can refactor existing Unity projects and create new ones.
- Using Zenject Signals, make loosely coupled connections.
- Improve mobile game performance by utilising Zenject's Memory Pool classes.
- Unit tests can be written using Zenject and MOQ.
Syllabus :
1. Dependency Injections basics
- Introduction to the Dependency Injection basics
- What is a Dependency Injection?
- Why do we need Dependency Injection?
- Object Graph
- Constructor, Method, Field and Property injection
2. Injecting MonoBehaviour classes
- Injecting MonoBehaviour class with Zenject Bindings
- Basic Bindings using Containers
- Installers
- Reusing Installers
- Context classes
- Validating the scene injections
- Injecting into a PlayerPrefab using Zenject Auto Injecter
3. Binding
- ContractType and ResultType
- Construction Method for non-MonoBehaviour classes
- WithArguments method
- Construction Method for MonoBehaviour classes
- Game Object Bind Methods
- Lazily created objects
- Scope: AsTransient vs AsSingle vs AsCached
- Inject by Id
- Conditional Bindings using InjectContext
- Optional Binding
- Back to the Zenject Binding
- Convention Based Binding
- Unbind and Rebind
4. Adding non-MonoBehaviour classes to the Unity lifecycle
- ITickable, IInitializable, IDisposable
- Update / Initialization Order
- Do not create IInitializable, ITickable and IDisposable objects dynamically!
5. Container
- Object instantiation using container
- Passing Extra Arguments
- Inject and QueueForInject
- Resolve
- Zenject Order Of Operations
6. Refactoring: Removing other patterns
- Singleton and Service Locator in Unity
- Is Singleton bad?
- Is Service Locator bad?
- Configuring Singletons using Project Context
7. Prefab Instantiation using Factory
- Why not simply use Instantiate?
- Factory Pattern using Zenject
- Abstract Factory
- Passing parameters to the factory
- Custom Factory
- Validating a custom factory
- Custom Factory Interface
8. Memory Pools
- Why using memory pools?
- Resetting objects
- Resetting MonoBehaviour objects using MonoMemoryPool
- Syntax
- Passing parameters to the memory pool
- Using memory pool in the client code
- Abstract Memory Pools
- Instantiating Memory Pools Directly
9. SubContainers
- Facade pattern
- Creating a container from the code
- Construction Method using SubContainers
- GameObjectContext
- Creating GameObjectContext using a Factory
- Using IInitializable / ITickable / IDisposable within SubContainers
10. Dealing with multiple scenes
- Injecting data across scenes using ZenjectSceneLoader
- Scene Parenting Using Contract Names
- Scene Decorators
11. Building an Event System
- Why using an event system?
- Event System By The Book
- Zenject Signals (Version 5.5.1)
- Signal Bindings
- Additional Declaration methods
12. Unit and Integration Testing with Zenject
- Why do we need unit testing and integration testing?
- Unit Testing with ZenjectUnitTestFixture class
- MOQ: Installation and usage
13. What’s new in Zenject 6.1.1
- Version 6.1.1 - Breaking Changes first!
- Zenject Settings
- Signals Redesigned
- Just-In-Time Resolving Using LazyInject
- Decorator pattern in Zenject
- Memory Pools