Represents an object that can provide a value of type T on demand. If a class derives from UnityEngine.Object and implements IValueProvider<T> then Any<T> can wrap an instance of the class and return its the Value whenever Any<T>.Value is called. This can enable patterns such as: ScriptableObject asset that provides a reference to a singleton ..
Methods void Init(TFirstArgument firstArgument, … TFifthArgument fifthArgument); 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 ..
IArgs<T…> Classes that implement one of the generic IArgs<T…> interfaces can be provided with arguments during initialization (up to a maximum of six). 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 ..
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 ..