![]() |
Init(args)
Scripting Reference
|
Represents an object which can receive an argument of type TArgument as part of its initialization process.
UnityEngine.Object-derived classes that implement this interface can be instantiated with their dependency using the InstantiateExtensions.Instantiate<TObject, TArgument> function.
MonoBehaviour-derived classes that implement this interface can be added to a GameObject with their dependency using the GameObject.AddComponent{TComponent, TArgument} function.
If the class also implements IInitializable<TArgument> then these functions can automatically inject the dependency to the IInitializable<TArgument>.Init function at the end of the initialization process; after the Awake and OnEnable events but before the Start event.
If the class does not implement IInitializable<TArgument>, or if you you would like to retrieve the dependency at an earlier stage of the initialization process, you can use InitArgs.TryGet<TArgument>.
TArgument | Type of the argument. |
Public Member Functions | |
void | Validate (TArgument argument) |
Validates the initialization argument that was provided to this client. | |