Services that can be registered for clients in Init(args) can be split into two categories: global and local services.
A global service, is a service that exists for the entire lifetime of the application, and is always available to all clients, regardless of the clients location in the scene hierarchies.
A global service can be registered in the following ways:
- By adding the [Service] attribute to a class.
- By attaching the Service Tag to a component and setting Availability to Everywhere.
- By dragging a component or a scriptable object into a Services component and setting For Clients to Everywhere.
- By manually calling Service.Set.
Plain old C# objects (non-components) can be registered as global services in the following ways:
- By adding the [Service] attribute to its class.
- By attaching the Service Tag to a Wrapper that wraps the object and setting Availability to Everywhere.
- By dragging a Value Provider that returns the object into a Services component and setting For Clients to Everywhere.
- By manually calling Service.Set.