Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.ScriptableObjectInitializer< TClient, TFirstArgument, TSecondArgument > Class Template Referenceabstract

Description

A base class for an initializer that can be used to specify the two arguments used to initialize a scriptable object that implements IInitializable<TFirstArgument, TSecondArgument>.

The arguments can be assigned using the inspector and are serialized as a sub-asset of the client scriptable object.

The arguments get 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.

Template Parameters
TClientType of the initialized scriptable object.
TFirstArgumentType of the first argument to pass to the client's Init function.
TSecondArgumentType of the second argument to pass to the client's Init function.
Type Constraints
TClient :ScriptableObject 
TClient :IInitializable 
TClient :TFirstArgument 
TClient :TSecondArgument 
Inheritance diagram for Sisus.Init.ScriptableObjectInitializer< TClient, TFirstArgument, TSecondArgument >:
Sisus.Init.ScriptableObjectInitializerBase< TClient, TFirstArgument, TSecondArgument > Sisus.Init.IInitializer< TClient, TFirstArgument, TSecondArgument > Sisus.Init.IInitializer< TClient > Sisus.Init.IValueProvider< TValue > Sisus.Init.IValueByTypeProvider Sisus.Init.IInitializer< TClient > Sisus.Init.IInitializer Sisus.Init.IValueProvider Sisus.Init.IInitializer

Additional Inherited Members

- Public Member Functions inherited from Sisus.Init.IInitializer< TClient >
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.
 
- Public Member Functions inherited from Sisus.Init.IInitializer
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.
 
- Protected Member Functions inherited from Sisus.Init.ScriptableObjectInitializerBase< TClient, TFirstArgument, TSecondArgument >
override TClient InitTarget ([AllowNull] TClient target)
 
virtual void OnReset (ref TFirstArgument firstArgument, ref TSecondArgument secondArgument)
 Resets the Init arguments to their default values.
 
- Properties inherited from Sisus.Init.ScriptableObjectInitializerBase< TClient, TFirstArgument, TSecondArgument >
TFirstArgument FirstArgument [get, set]
 The first argument passed to the TClient client's Init function.
 
TSecondArgument SecondArgument [get, set]
 The second argument passed to the TClient client's Init function.
 
- Properties inherited from Sisus.Init.IInitializer
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.