This commit is contained in:
Mausham
2026-05-28 17:09:12 +05:45
parent e6b6683feb
commit f9a2532495
18 changed files with 169 additions and 138 deletions

View File

@@ -10,7 +10,7 @@ namespace Darkmatter.Features.Colorbook.Installers
{
public void Register(IContainerBuilder builder)
{
builder.RegisterEntryPoint<ColorbookFlowController>(Lifetime.Singleton);
builder.RegisterEntryPoint<ColorbookFlowController>();
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Threading;
using Cysharp.Threading.Tasks;
using Darkmatter.Core.Contracts.Features.DrawingCatalog;
using Darkmatter.Core.Contracts.Features.Loading;
using VContainer.Unity;
namespace Darkmatter.Features.Colorbook.System;
@@ -8,9 +9,18 @@ namespace Darkmatter.Features.Colorbook.System;
public class ColorbookFlowController : IAsyncStartable
{
private readonly IDrawingCatalogController _drawingCatalog;
private readonly ILoadingScreen _loadingScreen;
public ColorbookFlowController(IDrawingCatalogController drawingCatalog, ILoadingScreen loadingScreen)
{
_drawingCatalog = drawingCatalog;
_loadingScreen = loadingScreen;
}
public async UniTask StartAsync(CancellationToken cancellation = new CancellationToken())
{
_loadingScreen.SetProgress(1f);
await _drawingCatalog.InitializeAsync(cancellation);
_loadingScreen.Hide();
}
}

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using Darkmatter.Core.Contracts.Features.DrawingCatalog;
using Darkmatter.Features.DrawingCatalog.Systems;
using VContainer.Unity;
namespace Darkmatter.Features.DrawingCatalog
@@ -15,7 +14,7 @@ namespace Darkmatter.Features.DrawingCatalog
private readonly IDrawingTemplateCatalog _catalog;
private readonly CancellationTokenSource _cts = new();
public DrawingCatalogPresenter(DrawingCatalogView view, DrawingCatalogController controller,
public DrawingCatalogPresenter(DrawingCatalogView view, IDrawingCatalogController controller,
IDrawingTemplateCatalog catalog)
{
_view = view;

View File

@@ -41,6 +41,8 @@ namespace Darkmatter.Features.MainMenuFlow.Flow
_loadingScreen.Show();
var progress = new Progress<float>(p => _loadingScreen.SetProgress(p * 0.5f));
await _sceneService.LoadSceneAsync(nameof(GameScene.Colorbook), progress, ct);
var mappedProgress = new Progress<float>(p => _loadingScreen.SetProgress(0.5f + p * 0.25f));
await _sceneService.UnloadSceneAsync(nameof(GameScene.MainMenu),mappedProgress, ct);
}
public void Dispose()