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

Description

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

See also
MonoBehaviour<TArgument>, ScriptableObject<TArgument>
Inheritance diagram for Sisus.Init.IInitializable< TArgument >:
Sisus.Init.IArgs< TArgument > Sisus.Init.IOneArgument Sisus.Init.IFirstArgument< TFirstArgument > 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 Init (TArgument argument)
 Initializes the object with an object that it depends on.
 
- Public Member Functions inherited from Sisus.Init.IArgs< TArgument >
void Validate (TArgument argument)
 Validates the initialization argument that was provided to this client.