Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.IArgs< TArgument > Interface Template Reference

Description

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>.

Template Parameters
TArgumentType of the argument.
See also
IInitializable<TArgument>, MonoBehaviour<TArgument>, ScriptableObject<TArgument>
Inheritance diagram for Sisus.Init.IArgs< TArgument >:
Sisus.Init.IOneArgument Sisus.Init.IFirstArgument< TFirstArgument > Sisus.Init.IInitializable< TArgument > Sisus.Init.IWrapper< TWrapped > Sisus.Init.MonoBehaviour< TArgument > Sisus.Init.Requires< TArgument > Sisus.Init.ScriptableObject< TArgument > Sisus.Init.StateMachineBehaviour< TArgument > Sisus.Init.ScriptableWrapper< TWrapped > Sisus.Init.Wrapper< TWrapped >

Public Member Functions

void Validate (TArgument argument)
 Validates the initialization argument that was provided to this client.