Init(args) contains new generic versions of the ScriptableObject base class, extending it with the ability to specify upto six objects that the class depends on. For example the following GameEvent class depends on a string and a GameObject. public class GameEvent : ScriptableObject<string, GameObject> When you create a class that inherits from one of the ..
Author : Timo Naskali
The project comes with a simple demo game showcasing many of the features offered by Init(args). It acts as an example of a very flexible and easily unit-testable architecture that can scale well to drive large projects as well. Installing Dependencies Before installing the demo game you must first install the Unity UI and Test ..
To reference code in Init(args) from your own code you need to create assembly definition assets in the roots of your script folders and add references to the assemblies containing the scripts you want to use. Init(args) contains three assemblies: InitArgs – The main assembly that contains most classes including MonoBehaviour<T…>. InitArgs.Services – This contains ..
You may want to check from time to time if Init(args) has new updates so you don’t miss out on new features and fixes. Updating To The Latest Version The process for updating Init(args) is very similar to installing it, and done using the Package Manager window inside of Unity. You can do so by ..
Init(args) can be installed using the Package Manager window inside Unity. You can do so by following these steps: Open the Package Manager window using the menu item Window > Package Management > Package Manager. Select the My Assets view. Search for Init(args) – A next-gen DI framework and select it. If you see a Download button, ..
Defining a Global Service You can define a global service in Init(args) by simply adding the [Service] attribute to any class: [Service] class GameManager { } This will instruct Init(args) to automatically create and cache a single instance of the the class when the project starts. Ready To Use Before Scene Load Global services are ..
Init(args) extends the MonoBehaviour class with the ability to receive up to twelve arguments during its initialization, before any of its lifetime events are executed. To enable your component to receive objects passed to it from the outside, make the class derive from MonoBehaviour<>, and list the types of all the objects needed as generic type ..
Init(args) is a straightforward and type-safe solution for providing your components with all the objects that they depend on. Here are some reasons why Init(args) could be the ideal choice to power the architecture of your next game… It’s Simple Init(args)’s Inspector and attribute-based workflow is incredibly intuitive – the basics can literally be learned ..