added gameplay lifetimescope

This commit is contained in:
Savya Bikram Shah
2026-05-27 12:13:45 +05:45
parent 50ca3a0a0f
commit 442836ad89
28 changed files with 349 additions and 19 deletions

View File

@@ -3,16 +3,19 @@ using UnityEngine;
using VContainer;
using VContainer.Unity;
public abstract class BaseLifetimeScope : LifetimeScope
namespace Darkmatter.App.LifetimeScopes
{
[SerializeField] private MonoBehaviour[] serviceModules;
protected override void Configure(IContainerBuilder builder)
public abstract class BaseLifetimeScope : LifetimeScope
{
foreach (var module in serviceModules)
[SerializeField] private MonoBehaviour[] serviceModules;
protected override void Configure(IContainerBuilder builder)
{
if (module is IServiceModule serviceModule)
serviceModule.Register(builder);
foreach (var module in serviceModules)
{
if (module is IServiceModule serviceModule)
serviceModule.Register(builder);
}
}
}
}

View File

@@ -1,8 +1,11 @@
using VContainer;
public class GameLifetimeScope : BaseLifetimeScope
namespace Darkmatter.App.LifetimeScopes
{
protected override void Configure(IContainerBuilder builder)
public class GameLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}
}

View File

@@ -0,0 +1,6 @@
namespace Darkmatter.App.LifetimeScopes
{
public class GameplayLifetimescope : BaseLifetimeScope
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b08651ebc7d8347b4957067e8be677bc

View File

@@ -1,9 +1,11 @@
using VContainer;
using VContainer.Unity;
public class RootLifetimeScope : BaseLifetimeScope
namespace Darkmatter.App.LifetimeScopes
{
protected override void Configure(IContainerBuilder builder)
public class RootLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}
}