![]() |
Init(args)
Scripting Reference
|
A base class for an initializer that can be used to specify the argument used to initialize a scriptable object that implements IInitializable<TArgument>.
The argument can be assigned using the inspector and is serialized as a sub-asset of the client scriptable object.
The argument gets injected to the TClient client during the client's Awake event, or when services become ready (whichever occurs later).
The client receives the argument via the Init method where it can assign it to a member field or property.
TClient | Type of the initialized scriptable object. |
TArgument | Type of the argument to pass to the client's Init function. |
TClient | : | ScriptableObject | |
TClient | : | IInitializable<TArgument> |
Additional Inherited Members | |
![]() | |
new TClient | InitTarget () |
Initializes the client object of type TClient with the arguments specified by this initializer. | |
new System.Threading.Tasks.Task< TClient > | InitTargetAsync () |
Initializes the client object of type TClient asynchronously with the arguments specified by this initializer. | |
![]() | |
bool | TargetIsAssignableOrConvertibleToType (Type type) |
Gets a value indicating whether an object of the given type can be assigned to the Target property directly, or if type implements IValueProvider<T>, IValueByTypeProvider or IValueByTypeProviderAsync. | |
![]() | |
override TClient | InitTarget ([AllowNull] TClient target) |
virtual void | OnReset (ref TArgument argument) |
Resets the Init arguments to their default values. | |
![]() | |
TArgument | Argument [get, set] |
The argument passed to the TClient client's Init function. | |
![]() | |
Object | Target [get, set] |
Existing target instance to initialize, if any. | |
bool | ProvidesCustomInitArguments [get] |
Gets a value indicating whether this initializer is able to provide custom per-instance Init arguments for its client. | |