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

◆ InitTarget()

new TClient Sisus.Init.IInitializer< TClient >.InitTarget ( )

Initializes the client object of type TClient with the arguments specified by this initializer.

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

If IInitializer.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 IInitializer.Target is null, and the initializer is a component, then a new component of type TClient 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 of type TClient.

Implements Sisus.Init.IInitializer.