Added BaseLifetimescope and gameplay scene

This commit is contained in:
Savya Bikram Shah
2026-05-26 18:59:54 +05:45
parent a1ba052ece
commit 0b4aeb8fd8
24 changed files with 647 additions and 133 deletions

View File

@@ -0,0 +1,18 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
public abstract class BaseLifetimeScope : LifetimeScope
{
[SerializeField] private MonoBehaviour[] serviceModules;
protected override void Configure(IContainerBuilder builder)
{
foreach (var module in serviceModules)
{
if (module is IServiceModule serviceModule)
serviceModule.Register(builder);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 14a5b12dfbd0540478508a72b0bcc3cc

View File

@@ -0,0 +1,8 @@
using VContainer;
public class GameLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4ca410c053f074e1cba2f7041f500d34

View File

@@ -1,18 +1,9 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
public class RootLifetimeScope : LifetimeScope
public class RootLifetimeScope : BaseLifetimeScope
{
[SerializeField] private MonoBehaviour[] serviceModules;
protected override void Configure(IContainerBuilder builder)
{
foreach (var module in serviceModules)
{
if (module is IServiceModule serviceModule)
serviceModule.Register(builder);
}
}
}