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

◆ GetFor< TService >() [2/2]

static TService Sisus.Init.Service.GetFor< TService > ( [DisallowNull] GameObject client)
static

Gets service of type TService for client .

The service can be retrieved from Services components in the active scenes, or failing that, from the globally shared Service<TService>.Instance.

This method can only be called from the main thread.

Template Parameters
TServiceThe defining type of the service.
Parameters
clientThe client GameObject that needs the service.
Returns
Service of type TService .
Exceptions
NullReferenceExceptionThrown if no service of type TService is found that is accessible to the client .