![]() |
Init(args)
Scripting Reference
|
Represents an object which can be initialized using an argument of type TArgument .
Object-derived classes that implement this interface can be instantiated with an argument using the InstantiateExtensions.Instantiate<TObject, TArgument>(TObject, TArgument) method.
MonoBehaviour-derived classes that implement this interface can also be added to a GameObject with an argument using the AddComponentExtensions.AddComponent<TComponent, TArgument>(GameObject, TArgument) method.
These functions will pass the argument to the IInitializable<TArgument>.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 argument at an earlier stage of its initialization process, such as in the constructor or during the Awake event, using InitArgs.TryGet<TArgument>.
Public Member Functions | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. | |
![]() | |
void | Validate (TArgument argument) |
Validates the initialization argument that was provided to this client. | |