
Services that can automatically be delivered to clients by Init(args) can be split into two groups based on their availability: local and global services.
A local service is a service that is only available to select clients, depending on their location in the scene hierarchies.
Unlike global services, local services only exist for a limited time – until they or the GameObject to which they’re attached is destroyed.
Registering Local Services
Local services can be registered using any the following methods:
- By attaching the Service Tag to a component and setting Availability to something other than Everywhere.
- By dragging an Object into a Services component and setting To Clients to something other than Everywhere.
- Manually using Service.AddFor with a clients argument other than Everywhere.
Registering Plain C# Objects
Plain C# objects can be registered as local services using any the following methods:
- By attaching the Service Tag to a Wrapper that wraps the plain C# object.
- By dragging a value provider that returns the plain C# object into a Services component.