{"id":448,"date":"2024-10-22T08:03:30","date_gmt":"2024-10-22T08:03:30","guid":{"rendered":"https:\/\/docs.sisus.co\/init-args\/?p=448"},"modified":"2025-07-29T06:36:46","modified_gmt":"2025-07-29T06:36:46","slug":"local-services","status":"publish","type":"post","link":"https:\/\/docs.sisus.co\/init-args\/reference\/local-services\/","title":{"rendered":"Local Services"},"content":{"rendered":"<p><img loading=\"lazy\" class=\" wp-image-918 aligncenter\" src=\"https:\/\/docs.sisus.co\/init-args\/wp-content\/uploads\/sites\/6\/2024\/10\/local-services.png\" alt=\"\" width=\"256\" height=\"256\" srcset=\"https:\/\/docs.sisus.co\/init-args\/wp-content\/uploads\/sites\/6\/2024\/10\/local-services.png 512w, https:\/\/docs.sisus.co\/init-args\/wp-content\/uploads\/sites\/6\/2024\/10\/local-services-300x300.png 300w, https:\/\/docs.sisus.co\/init-args\/wp-content\/uploads\/sites\/6\/2024\/10\/local-services-150x150.png 150w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/p>\n<p>Services that can automatically be delivered to <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/clients\/monobehaviour-t\/\">clients<\/a><\/strong> by Init(args) can be split into two groups based on their availability: <strong>local<\/strong> and <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/reference\/global-services\/\">global services<\/a><\/strong>.<\/p>\n<p>A local service is a service that is only available to select clients, depending on their location in the scene hierarchies.<\/p>\n<p>Unlike global services, local services only exist for a limited time &#8211; until they or the GameObject to which they&#8217;re attached is destroyed.<\/p>\n<h2>Registering Local Services<\/h2>\n<p>Local services can be registered using any the following methods:<\/p>\n<ol>\n<li>By attaching the <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/features\/service-tag\/\">Service Tag<\/a><\/strong> to a component and setting <em>Availability<\/em> to something other than <em>Everywhere<\/em>.<\/li>\n<li>By dragging an Object into a <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/features\/services-component\/\">Services component<\/a><\/strong>\u00a0and setting <em>To Clients<\/em> to something other than <em>Everywhere<\/em>.<\/li>\n<li>Manually using <strong><a href=\"https:\/\/docs.sisus.co\/init-args-reference\/class_sisus_1_1_init_1_1_service_a3691e6bdafc97e223b1ca4280a28ab6c.html\">Service.AddFor<\/a><\/strong> with a <em>clients<\/em> argument other than <em>Everywhere<\/em>.<\/li>\n<\/ol>\n<h2>Registering Plain C# Objects<\/h2>\n<p>Plain C# objects can be registered as local services using any the following methods:<\/p>\n<ol>\n<li>By attaching the <strong>Service Tag<\/strong> to a <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/features\/wrapper\/\">Wrapper<\/a><\/strong> that wraps the plain C# object.<\/li>\n<li>By dragging a <strong><a href=\"https:\/\/docs.sisus.co\/init-args\/reference\/ivalueprovider\/\">value provider<\/a><\/strong> that returns the plain C# object into a <strong>Services<\/strong> component.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>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 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/docs.sisus.co\/init-args\/reference\/local-services\/\" title=\"read more\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/posts\/448"}],"collection":[{"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":12,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":994,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/posts\/448\/revisions\/994"}],"wp:attachment":[{"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.sisus.co\/init-args\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}