Added BaseLifetimescope and gameplay scene
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14a5b12dfbd0540478508a72b0bcc3cc
|
||||
@@ -0,0 +1,8 @@
|
||||
using VContainer;
|
||||
|
||||
public class GameLifetimeScope : BaseLifetimeScope
|
||||
{
|
||||
protected override void Configure(IContainerBuilder builder)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ca410c053f074e1cba2f7041f500d34
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user