Intro done and event after intro

This commit is contained in:
Savya Bikram Shah
2026-05-28 15:04:47 +05:45
parent f1b0834a72
commit 0e50fa5e55
59 changed files with 906 additions and 12 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e7d1320ac2ff4ba4ae4bff41efa01e29
timeCreated: 1779959661

View File

@@ -0,0 +1,3 @@
namespace Darkmatter.Core.Data.Signals.Features.AppBoot;
public record struct IntroCompletedSignal();

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a44d51add9914de6bc28b428e13aaecb
timeCreated: 1779959670

View File

@@ -4,6 +4,7 @@
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:b4c9f7fbf1e144933a1797dc208ece5f",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],

View File

@@ -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());
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 56c469bea638b43dc96015d33d220a8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
namespace Darkmatter.Libs.Observer
{
public class ObserverLibraryModule : MonoBehaviour, IModule
{
public void Register(IContainerBuilder builder)
{
builder.Register<IEventBus, EventBus>(Lifetime.Singleton);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: aa2c71d11c78f4c16a545758585358bf

View File

@@ -2,7 +2,8 @@
"name": "Libs.Observer",
"rootNamespace": "Darkmatter.Libs.Observer",
"references": [
"VContainer"
"VContainer",
"Libs.Installers"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c1526335c9abe4f65b4c4d0da98cd44a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: