Files
RebootKit/Runtime/Engine/Code/MainSceneInstaller.cs
2025-04-14 23:22:38 +02:00

15 lines
557 B
C#

using RebootKit.Engine.Foundation;
using UnityEngine;
namespace RebootKit.Engine {
public class MainSceneInstaller : SceneDependencyInstaller {
public override void Install(DIContext context) {
foreach (GameObject rootGameObject in gameObject.scene.GetRootGameObjects()) {
IService[] services = rootGameObject.GetComponentsInParent<IService>();
foreach (IService service in services) {
context.Bind(service.GetType(), service);
}
}
}
}
}