mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-05 07:41:10 +00:00
init: add project
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using Assets._Project.Develop.Runtime.Infrastructure;
|
||||
using Assets._Project.Develop.Runtime.Infrastructure.DI;
|
||||
using Assets._Project.Develop.Runtime.Utilities.SceneManagement;
|
||||
using System.Collections;
|
||||
|
||||
namespace Assets._Project.Develop.Runtime.Meta.Infrastructure
|
||||
{
|
||||
public class MainMenuBootstrap : SceneBootstrap
|
||||
{
|
||||
private DIContainer _container;
|
||||
|
||||
public override void ProcessRegistrations(DIContainer container, IInputSceneArgs sceneArgs = null)
|
||||
{
|
||||
_container = container;
|
||||
|
||||
MainMenuContextRegistrations.Process(_container);
|
||||
}
|
||||
|
||||
public override IEnumerator Initialize()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
public override void Run()
|
||||
{ }
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c18e030accfe8446bfca4a0bc7ebbb5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
using _Project.Develop.Runtime.UI;
|
||||
using _Project.Develop.Runtime.UI.Core;
|
||||
using _Project.Develop.Runtime.UI.Screens.MainMenu;
|
||||
using Assets._Project.Develop.Runtime.Infrastructure.DI;
|
||||
using Assets._Project.Develop.Runtime.Utilities.AssetsManagement;
|
||||
using Assets._Project.Develop.Runtime.Utilities.SceneManagement;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Assets._Project.Develop.Runtime.Meta.Infrastructure
|
||||
{
|
||||
public class MainMenuContextRegistrations
|
||||
{
|
||||
public static void Process(DIContainer container)
|
||||
{
|
||||
container.RegisterAsSingle(CreateMainMenuUIRoot).NonLazy();
|
||||
container.RegisterAsSingle(CreateMainMenuPresentersFactory);
|
||||
container.RegisterAsSingle(CreateMainMenuScreenPresenter).NonLazy();
|
||||
container.RegisterAsSingle(CreateMainMenuPopupService);
|
||||
}
|
||||
|
||||
private static MainMenuPresentersFactory CreateMainMenuPresentersFactory(DIContainer c) => new(c);
|
||||
|
||||
private static MainMenuPopupService CreateMainMenuPopupService(DIContainer c)
|
||||
{
|
||||
return new MainMenuPopupService(
|
||||
c.Resolve<ViewsFactory>(),
|
||||
c.Resolve<ProjectPresentersFactory>(),
|
||||
c.Resolve<MainMenuUIRoot>());
|
||||
}
|
||||
|
||||
private static MainMenuUIRoot CreateMainMenuUIRoot(DIContainer c)
|
||||
{
|
||||
ResourcesAssetsLoader loader = c.Resolve<ResourcesAssetsLoader>();
|
||||
MainMenuUIRoot uiRootPrefab = loader.Load<MainMenuUIRoot>(PathToResources.UI.Screens.MainMenu);
|
||||
|
||||
return Object.Instantiate(uiRootPrefab);
|
||||
}
|
||||
|
||||
private static MainMenuScreenPresenter CreateMainMenuScreenPresenter(DIContainer c)
|
||||
{
|
||||
MainMenuUIRoot uiRoot = c.Resolve<MainMenuUIRoot>();
|
||||
MainMenuScreenView view = c.Resolve<ViewsFactory>().Create<MainMenuScreenView>(uiRoot.HUDLayer);
|
||||
MainMenuScreenPresenter presenter = c.Resolve<MainMenuPresentersFactory>().CreateMainMenuScreen(view);
|
||||
|
||||
return presenter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a75665c6d4b5574dbfa1ffa841b7348
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user