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

◆ ExistsFor()

static bool Sisus.Init.ServiceUtility.ExistsFor ( [DisallowNull] object client,
[DisallowNull] Type definingType )
static

Determines whether service of type TService is available for the client .

The service can be located 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.

Parameters
clientThe client that needs the service.
definingTypeThe defining type of the service; the class or interface type that uniquely defines the service and can be used to retrieve an instance of it.

This must be an interface that the service implement, a base type that the service derives from, or the exact type of the service.

Returns
true if service of the given type exists for the client; otherwise, false.