Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.StateMachineBehaviourInitializer< TStateMachineBehaviour, TArgument > Class Template Referenceabstract

Description

A base class for a component that can be used to specify the argument used to initialize a state machine behaviour of type TStateMachineBehaviour that implements IInitializable<TArgument>.

The argument value can be assigned using the inspector and serialized as part of a scene or a prefab.

The argument gets injected to the TStateMachineBehaviour client during the Awake event.

The client receives the argument via the Init method where it can assign them to a member field or property.

After the argument has been injected the StateMachineBehaviourInitializer<,> is removed from the GameObject that holds it.

Template Parameters
TStateMachineBehaviourType of the initialized state machine behaviour client.
TArgumentType of the argument to pass to the client's Init function.
Type Constraints
TStateMachineBehaviour :StateMachineBehaviour 
TStateMachineBehaviour :IInitializable<TArgument> 
Inheritance diagram for Sisus.Init.StateMachineBehaviourInitializer< TStateMachineBehaviour, TArgument >:
Sisus.Init.StateMachineBehaviourInitializerBase< TStateMachineBehaviour, TArgument > Sisus.Init.IInitializer< TClient, TArgument > 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

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.StateMachineBehaviourInitializerBase< TStateMachineBehaviour, TArgument >
override TStateMachineBehaviour InitTarget ([DisallowNull] Animator target)
 
virtual void OnReset (ref TArgument argument)
 Resets the Init argument to their default values.
 
- Properties inherited from Sisus.Init.StateMachineBehaviourInitializerBase< TStateMachineBehaviour, TArgument >
TArgument Argument [get, set]
 The argument passed to the TStateMachineBehaviour 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.