Class ServicesBehaviour
Base behaviour to manage services. Provides two methods to override:
- OnRegistryReady when the services registry has been set
- OnServicesReady when the services have been initialized
Inherited Members
Namespace: Unity.Services.Core.Components
Assembly: Unity.Services.Core.Components.dll
Syntax
public abstract class ServicesBehaviour : MonoBehaviour
Fields
ServicesIdentifier
Unique local identifier for the custom set of services. Used as the key in the registries dictionary.
Declaration
[SerializeField]
[Tooltip("Unique local identifier for the custom set of services. Used as the key in the registries dictionary.")]
[Visibility("UseCustomServices", true)]
public string ServicesIdentifier
Field Value
Type | Description |
---|---|
string |
UseCustomServices
Use this to setup a custom services registry. All services in a registry are unique.
Declaration
[Header("Services Registry")]
[Tooltip("Use this to setup a custom services registry. All services in a registry are unique.")]
[SerializeField]
public bool UseCustomServices
Field Value
Type | Description |
---|---|
bool |
Properties
Services
Access to the services registry. The registry is set in Start.
Declaration
public IUnityServices Services { get; }
Property Value
Type | Description |
---|---|
IUnity |
Methods
Cleanup()
Called on destroy to cleanup
Declaration
protected abstract void Cleanup()
OnServicesInitialized()
Called when the services are initialized and ready to be used
Declaration
protected abstract void OnServicesInitialized()
OnServicesReady()
Called when the services registry is set and ready to be used
Declaration
protected abstract void OnServicesReady()