![]() |
Init(args)
Scripting Reference
|
Represents an object which can be initialized using three arguments.
Object-derived classes that implement this interface can be instantiated with an argument using the InstantiateExtensions.Instantiate<TObject, TFirstArgument, TSecondArgument, TThirdArgument>(TObject, TFirstArgument, TSecondArgument, TThirdArgument) 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>(GameObject, TFirstArgument, TSecondArgument, TThirdArgument) method.
These functions can automatically inject the arguments using the IInitializable<TFirstArgument, TSecondArgument, TThirdArgument>.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>.
Public Member Functions | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. | |
![]() | |
void | Validate (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Validates the initialization arguments that were provided to this client. | |