Category : 05. Reference

Represents an object that can provide a value of type T on demand. The value of a UnityEngine.Object-derived class that implements IValueProvider<T> can be assigned to an Init argument field of type T. When this is done, the value returned by the provider at runtime will be passed to the client during initialization. This can ..

Read more

Methods void Init(TFirstArgument firstArgument, … TwelfthArgument twelfthArgument); Classes that implement IInitializable<T…> have all the same functionality that they would get by implementing an IArgs<T…> interface, but with additional support for their Init function to be called manually by other classes. This makes it possible for classes to inject dependencies even in cases where the object ..

Read more

IArgs<T…> Classes that implement one of the generic IArgs<T…> interfaces can be provided with arguments during initialization (up to a maximum of twelve). Methods such as Instantiate<TObject, T…> and AddComponent<TComponent, T…> can only be used to create instances of classes that implement one of the IArgs<T…> interfaces. A contract to receive arguments Any object that ..

Read more

The InitArgs class is the bridge through which initialization arguments are passed from the classes that create instances to the objects that are being created (called clients). Note that in most cases you don’t need to use InitArgs directly; all of the various methods provided for initializing instances with arguments already handle this for you ..

Read more