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

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

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

Gets service of type TService for client .

The returned service can be a local service registered using a ServiceTag or a Services component in an active scene, or if one is not found, a global service registered using a ServiceAttribute or manually.

This method can only be called from the main thread.

Template Parameters
TServiceThe defining type of the service.
Parameters
clientThe client 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 .