Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.ServiceUtility Class Reference

Description

Utility class responsible for providing information about services.

Static Public Member Functions

static object Get ([DisallowNull] Type definingType)
 Gets the shared service instance of the given definingType .
 
static bool TryGet ([DisallowNull] Type definingType, out object service)
 Gets the shared service instance of the given serviceType .
 
static object Get (object client, [DisallowNull] Type definingType, Context context=Context.MainThread)
 Gets the shared service instance of the given definingType .
 
static bool TryGetFor (object client, [DisallowNull] Type definingType, out object service, Context context=Context.MainThread)
 Gets the shared service instance of the given serviceType .
 
static bool ExistsFor ([DisallowNull] object client, [DisallowNull] Type definingType)
 Determines whether service of type TService is available for the client .
 
static void SetInstanceSilently ([DisallowNull] Type definingType, [AllowNull] object instance)
 Sets the service instance of the provided definingType type that is shared across clients to the given value.
 
static void Set ([DisallowNull] Type definingType, [AllowNull] object instance)
 Sets the service instance of the provided definingType type that is shared across clients to the given value.
 
static void AddFor ([AllowNull] object serviceOrProvider, [DisallowNull] Type definingType, Clients clients, [DisallowNull] Component registerer)
 Sets the service instance of the provided definingType type that is shared across clients to the given value.
 
static void RemoveFrom ([AllowNull] object serviceOrProvider, [DisallowNull] Type definingType, Clients clients, [DisallowNull] Component registerer)
 Sets the service instance of the provided definingType type that is shared across clients to the given value.
 
static bool IsServiceDefiningType< T > ()
 Gets a value indicating whether or not T is the defining type of a service.
 
static bool IsServiceDefiningType ([DisallowNull] Type type)
 Gets a value indicating whether the provided type is the defining type of a service.
 
static void EnsureAOTPlatformSupportForService< TService > ()
 A method that can be referenced with particular service types, to ensure that instance of said service can be registered using reflection on ahead-of-time compiled platforms without errors occurring.
 

Properties

static bool ServicesAreReady [get]
 true if all shared services that are loaded synchronously during game initialization have been created, initialized and are ready to be used by clients; otherwise, false.
 
static bool AsyncServicesAreReady [get]
 true if all shared services that are loaded asynchronously during game initialization have been created, initialized and are ready to be used by clients; otherwise, false.
 

Events

static Action ServicesBecameReady [add, remove]
 Event that is broadcast when all services have been created, initialized and are ready to be used by clients.