Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ InitTarget()

object Sisus.Init.IInitializer.InitTarget ( )

Initializes the client object with the arguments specified by this initializer.

If Target is attached to the same GameObject as the initializer, then this method initializes the IInitializer.Target and returns it.

If Target is attached to a different GameObject than the initializer, like for example a different prefab, then this method clones the IInitializer.Target, initializes the clone, and returns it.

If Target is null, the initializer is a component, and the client is a component type, then a new component is attached to the GameObject containing the initializer, initialized, and returned.

This method should be idempotent, meaning that if it is called multiple times, it should always return the same object, and that object should only get initialized once.

Returns
The initialized object.

Implemented in Sisus.Init.IInitializer< TClient >.