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

◆ TryGet< TService >()

static bool Sisus.Init.Service.TryGet< TService > ( [NotNullWhen(true), MaybeNullWhen(false)] out TService service)
static

Tries to get a global service of type TService .

The returned service can be a service registered using a ServiceTag or a Services component with availability set to Clients.Everywhere, or a service registered using a ServiceAttribute or manually.

This method can be called from any thread.

Template Parameters
TServiceThe defining type of the service.
Parameters
serviceWhen this method returns, contains service of type TService , if found; otherwise, null. This parameter is passed uninitialized.
Returns
true if service was found; otherwise, false.