Model shared runtime systems as Components.
ComponentService keeps global-style systems inside the same scene and lifecycle model used by s&box.
The component model
ComponentService derives directly from Sandbox.Component. Public concrete service types are discovered and placed on a dedicated Lithium Services GameObject in the active scene.
Use the normal Component lifecycle for initialization, updates and cleanup. This keeps dependencies visible in the scene instead of hiding them behind static state.
Create a service
A service is a public concrete class. Override the Component callbacks your system needs and keep the class focused on one runtime responsibility.
using Lithium.Services;
namespace Lithium.Inventory;
public sealed class InventoryService : ComponentService
{
protected override void OnStart()
{
Log.Info("Inventory service ready");
}
}Service boundaries
Prefer a few cohesive services over a single manager that owns every feature. Addon classes compose packages; services own long-lived scene behavior; regular Components own object-level behavior.