Intro done and event after intro
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
"references": [
|
||||
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
|
||||
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
|
||||
"GUID:b4c9f7fbf1e144933a1797dc208ece5f",
|
||||
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Darkmatter.Core.Contracts.Features.Progression;
|
||||
using Darkmatter.Core.Contracts.Services.Scenes;
|
||||
using Darkmatter.Core.Data.Signals.Features.AppBoot;
|
||||
using Darkmatter.Core.Enums.Services.Scenes;
|
||||
using Darkmatter.Features.AppBoot.SceneRefs;
|
||||
using Darkmatter.Libs.Observer;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Video;
|
||||
using VContainer.Unity;
|
||||
@@ -13,11 +16,13 @@ namespace Darkmatter.Features.AppBoot.Flow
|
||||
{
|
||||
private readonly AppBootSceneRefs _sceneRefs;
|
||||
private readonly ISceneService _sceneService;
|
||||
private readonly IEventBus _eventBus;
|
||||
|
||||
public AppBootFlow(AppBootSceneRefs sceneRefs, ISceneService sceneService)
|
||||
public AppBootFlow(AppBootSceneRefs sceneRefs, ISceneService sceneService, IEventBus eventBus)
|
||||
{
|
||||
_sceneRefs = sceneRefs;
|
||||
_sceneService = sceneService;
|
||||
_eventBus = eventBus;
|
||||
}
|
||||
|
||||
public async UniTask StartAsync(CancellationToken cancellation = default)
|
||||
@@ -33,7 +38,7 @@ namespace Darkmatter.Features.AppBoot.Flow
|
||||
|
||||
player.loopPointReached += OnDone;
|
||||
player.Play();
|
||||
await _sceneService.LoadSceneAsync(GameScene.MainMenu, null, cancellation);
|
||||
await _sceneService.LoadSceneAsync(nameof(GameScene.MainMenu), null, cancellation);
|
||||
|
||||
await tcs.Task.AttachExternalCancellation(cancellation);
|
||||
|
||||
@@ -44,6 +49,7 @@ namespace Darkmatter.Features.AppBoot.Flow
|
||||
if (_sceneRefs.IntroCanvas != null)
|
||||
Object.Destroy(_sceneRefs.IntroCanvas.gameObject);
|
||||
Object.Destroy(player.gameObject);
|
||||
_eventBus.Publish(new IntroCompletedSignal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,12 @@ namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuFeatureModule: MonoBehaviour, IModule
|
||||
{
|
||||
[SerializeField] private MainmenuView mainmenuView;
|
||||
[SerializeField] private MainMenuView mainMenuView;
|
||||
public void Register(IContainerBuilder builder)
|
||||
{
|
||||
if(mainmenuView!= null)
|
||||
if(mainMenuView!= null)
|
||||
{
|
||||
builder.RegisterEntryPoint<MainmenuPresenter>().WithParameter(mainmenuView);
|
||||
builder.RegisterEntryPoint<MainMenuPresenter>().WithParameter(mainMenuView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuPresenter : IStartable, IDisposable
|
||||
public class MainMenuPresenter : IStartable, IDisposable
|
||||
{
|
||||
private readonly MainmenuView _view;
|
||||
private readonly MainMenuView _view;
|
||||
|
||||
public MainmenuPresenter(MainmenuView view)
|
||||
public MainMenuPresenter(MainMenuView view)
|
||||
{
|
||||
_view = view;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Darkmatter.Features.Mainmenu
|
||||
{
|
||||
public class MainmenuView : MonoBehaviour
|
||||
public class MainMenuView : MonoBehaviour
|
||||
{
|
||||
[Header("UI Elements")]
|
||||
[SerializeField] private Button playBtn;
|
||||
Reference in New Issue
Block a user