Category : 6. Initialization

Value providers are a highly flexible system that can be used to provide Init arguments to initializers dynamically at runtime. Creating Value Providers To make a new value provider, create a ScriptableObject that implements IValueProvider<TValue> or IValueByTypeProvider. In order to be able to create assets from your value provider, you’ll also need to add the [CreateAssetMenu] ..

Read more

The [ValueProviderMenu] attribute can be used to introduce new menu items that will be shown in the dropdown menus for all Init arguments of targeted types. The attribute can be added to a ScriptableObject-derived class that implements IValueProvider<TValue> or IValueByTypeProvider. You can then use the Value property to access the value stored inside the field. ..

Read more

The generic GameObject structs are builders that can be used to initialize a GameObject and upto three components in a single line of code. If you want a GameObject with a single component to be build, initialize a new instance of the GameObject<T> struct and specify the type of the component you want attached to ..

Read more

A major benefit of injecting dependencies to your classes through the Init method is that it makes it easy to decouple your components from specific implementations when you use interfaces instead of specific classes as your argument types. The list of arguments that the Init method accepts also makes it very clear what other objects ..

Read more