Interface IUnityServices
Central registry for an instance of unity services.
Namespace: Unity.Services.Core
Assembly: Unity.Services.Core.dll
Syntax
public interface IUnityServices
Properties
State
The initialization state of the services instance.
Declaration
ServicesInitializationState State { get; }
Property Value
| Type | Description |
|---|---|
| ServicesInitializationState |
Methods
GetIdentifier()
Provides the unique identifier for the services registry or null for the main services.
Declaration
string GetIdentifier()
Returns
| Type | Description |
|---|---|
| string | The unique identifier for the services registry |
GetService<T>()
Retrieve a service from the service registry
Declaration
T GetService<T>()
Returns
| Type | Description |
|---|---|
| T | The service if available, otherwise null |
Type Parameters
| Name | Description |
|---|---|
| T | The type that was registered for the service |
InitializeAsync(InitializationOptions)
Initialize the services
Declaration
Task InitializeAsync(InitializationOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| InitializationOptions | options | The options for the services |
Returns
| Type | Description |
|---|---|
| Task | Return a handle to the asynchronous initialization process. |
Events
InitializeFailed
Invoked when initialization fails.
Declaration
event Action<Exception> InitializeFailed
Event Type
| Type | Description |
|---|---|
| Action<Exception> |
Initialized
Invoked when initialization completes successfully.
Declaration
event Action Initialized
Event Type
| Type | Description |
|---|---|
| Action |