![]() |
Init(args)
Scripting Reference
|
A base class for a component that can specify the constructor argument used to initialize a plain old class object which then gets wrapped by a Wrapper<TWrapped> component.
The argument value can be assigned using the inspector and serialized as part of a scene or a prefab.
The TWrapped wrapped object gets created and injected to the TWrapper wrapper component during the Awake event.
After the object has been injected the WrapperInitializer<,,> is removed from the GameObject that holds it.
TWrapper | Type of the initialized wrapper component. |
TWrapped | Type of the object wrapped by the wrapper. |
TArgument | Type of the first argument passed to the wrapped object's constructor. |
TWrapper | : | Wrapper<TWrapped> |
Properties | |
override TArgument | Argument [get, set] |
![]() | |
TArgument | Argument [get, set] |
The argument used to initialize the wrapped object. | |
![]() | |
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 | |
![]() | |
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 TWrapper | InitTarget ([AllowNull] TWrapper wrapper) |
TWrapped | CreateWrappedObject (TArgument argument) |
Creates a new instance of TWrapped initialized using the provided argument and returns it. | |