![]() |
Init(args)
Scripting Reference
|
Represents an object which can be initialized using six arguments.
Object-derived classes that implement this interface can be instantiated with an argument using the InstantiateExtensions.Instantiate<TObject, TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument>(TObject, TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument) method.
MonoBehaviour-derived classes that implement this interface can also be added to a GameObject with an argument using the AddComponentExtensions.AddComponent<TComponent, TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument>(GameObject, TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument) method.
These functions can automatically inject the arguments using the IInitializable<TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument>.Init function at the end of the initialization process; after the Awake and OnEnable events but before the Start event.
It is also possible for the object to receive the provided arguments at an earlier stage of its initialization process, such as in the constructor or during the Awake event, using InitArgs.TryGet<TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument, TSixthArgument>.
TFirstArgument | Type of the first argument passed to the Init method. |
TSecondArgument | Type of the second argument passed to the Init method. |
TThirdArgument | Type of the third argument passed to the Init method. |
TFourthArgument | Type of the fourth argument passed to the Init method. |
TFifthArgument | Type of the fifth argument passed to the Init method. |
TSixthArgument | Type of the sixth argument passed to the Init method. |
Public Member Functions | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument, TSixthArgument sixthArgument) |
Initializes the object with six objects that it depends on. | |
![]() | |
void | Validate (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument, TSixthArgument sixthArgument) |
Validates the initialization arguments that were provided to this client. | |