Minor fixes
This commit is contained in:
@@ -9,7 +9,6 @@ using Darkmatter.Core.Contracts.Features.GameplayFlow;
|
||||
using Darkmatter.Core.Contracts.Features.Loading;
|
||||
using Darkmatter.Core.Contracts.Features.Progression;
|
||||
using Darkmatter.Core.Contracts.Features.ShapeBuilder;
|
||||
using Darkmatter.Core.Contracts.Services.Gallery;
|
||||
using Darkmatter.Core.Contracts.Services.Scenes;
|
||||
using Darkmatter.Core.Data.Dynamic.Features.Progression;
|
||||
using Darkmatter.Core.Data.Signals.Features.Coloring;
|
||||
@@ -92,9 +91,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
_colorAppliedSub = _bus.Subscribe<ColorAppliedSignal>(OnColorApplied);
|
||||
_drawingSelectedSub = _bus.Subscribe<DrawingSelectedSignal>(OnDrawingSelected);
|
||||
|
||||
Application.quitting += OnAppQuitting;
|
||||
Application.focusChanged += OnAppFocusChanged;
|
||||
|
||||
_loadingScreen.SetProgress(1f);
|
||||
if (_phase == DrawingPhase.Coloring)
|
||||
{
|
||||
@@ -150,19 +146,8 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
await _scenes.UnloadSceneAsync(nameof(GameScene.Gameplay), progress: null, cancellationToken: default);
|
||||
_bus.Publish(new DrawingSelectedSignal(nextId));
|
||||
}
|
||||
|
||||
public void OnApplicationPaused()
|
||||
{
|
||||
SaveCurrentAsync(CancellationToken.None).Forget();
|
||||
}
|
||||
|
||||
private void OnAppQuitting() => OnApplicationPaused();
|
||||
|
||||
private void OnAppFocusChanged(bool focused)
|
||||
{
|
||||
if (!focused) OnApplicationPaused();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnShapeAssembled(ShapeAssembledSignal signal)
|
||||
{
|
||||
if (signal.TemplateId != _templateId) return;
|
||||
@@ -261,8 +246,6 @@ namespace Darkmatter.Features.GameplayFlow.Systems
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Application.quitting -= OnAppQuitting;
|
||||
Application.focusChanged -= OnAppFocusChanged;
|
||||
|
||||
_assembledSub?.Dispose();
|
||||
_colorAppliedSub?.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user