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

Description

A base class for a component that can specify the three arguments used to initialize an object of type TClient .

The arguments can be assigned using the inspector and are serialized as part of the client's scene or prefab asset.

The TClient client does not need to implement the IInitializable<TFirstArgument, TSecondArgument, TThirdArgument> interface. The initialization arguments can instead be injected, for example, directly into properties with public setters.

After the arguments have been injected the initializer is removed from the GameObject that holds it.

Template Parameters
TClientType of the initialized client component.
TFirstArgumentType of the first argument to inject to the client.
TSecondArgumentType of the second argument to inject to the client.
TThirdArgumentType of the third argument to inject to the client.
Type Constraints
TClient :Component 
Inheritance diagram for Sisus.Init.CustomInitializer< TClient, TFirstArgument, TSecondArgument, TThirdArgument >:
Sisus.Init.CustomInitializerBase< TClient, TFirstArgument, TSecondArgument, TThirdArgument > Sisus.Init.IInitializer< TClient, TFirstArgument, TSecondArgument, TThirdArgument > Sisus.Init.IInitializable Sisus.Init.IInitializer< TClient > Sisus.Init.IValueProvider< TValue > Sisus.Init.IValueByTypeProvider Sisus.Init.IInitializer< TClient > Sisus.Init.IInitializer Sisus.Init.IValueProvider Sisus.Init.IInitializer

Properties

override TFirstArgument FirstArgument [get, set]
 
override TSecondArgument SecondArgument [get, set]
 
override TThirdArgument ThirdArgument [get, set]
 
- Properties inherited from Sisus.Init.CustomInitializerBase< TClient, TFirstArgument, TSecondArgument, TThirdArgument >
TFirstArgument FirstArgument [get, set]
 The first argument injected to the TClient client.
 
TSecondArgument SecondArgument [get, set]
 The second argument injected to the TClient client.
 
TThirdArgument ThirdArgument [get, set]
 The third argument injected to the TClient client.
 
- 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.
 

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.CustomInitializerBase< TClient, TFirstArgument, TSecondArgument, TThirdArgument >
void InitTarget (TClient target, TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument)
 Initializes the target of type TClient using the provided arguments.
 
virtual void OnReset (ref TFirstArgument firstArgument, ref TSecondArgument secondArgument, ref TThirdArgument thirdArgument)
 Resets the Init arguments to their default values.