Scene Loading Script

This commit is contained in:
Savya Bikram Shah
2026-05-28 14:40:21 +05:45
parent e0e7601c27
commit dd6a7be1fc
31 changed files with 312 additions and 121 deletions

View File

@@ -1,6 +0,0 @@
namespace Darkmatter.App.LifetimeScopes
{
public class GameLifetimeScope : BaseLifetimeScope
{
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 4ca410c053f074e1cba2f7041f500d34

View File

@@ -4,6 +4,7 @@ namespace Darkmatter.Core.Enums.Services.Scenes
{
Boot,
MainMenu,
Colorbook,
Gameplay,
}
}

View File

@@ -1,5 +1,7 @@
using System.Threading;
using Cysharp.Threading.Tasks;
using Darkmatter.Core.Contracts.Services.Scenes;
using Darkmatter.Core.Enums.Services.Scenes;
using Darkmatter.Features.AppBoot.SceneRefs;
using UnityEngine;
using UnityEngine.Video;
@@ -10,10 +12,12 @@ namespace Darkmatter.Features.AppBoot.Flow
public class AppBootFlow : IAsyncStartable
{
private readonly AppBootSceneRefs _sceneRefs;
private readonly ISceneService _sceneService;
public AppBootFlow(AppBootSceneRefs sceneRefs)
public AppBootFlow(AppBootSceneRefs sceneRefs, ISceneService sceneService)
{
_sceneRefs = sceneRefs;
_sceneService = sceneService;
}
public async UniTask StartAsync(CancellationToken cancellation = default)
@@ -29,6 +33,7 @@ namespace Darkmatter.Features.AppBoot.Flow
player.loopPointReached += OnDone;
player.Play();
await _sceneService.LoadSceneAsync(GameScene.MainMenu, null, cancellation);
await tcs.Task.AttachExternalCancellation(cancellation);

View File

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

View File

@@ -0,0 +1,22 @@
{
"name": "Features.Coloring",
"rootNamespace": "Darkmatter.Features.Coloring",
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:c176ee863a5e74e88a6517f9f102cf92",
"GUID:b4c9f7fbf1e144933a1797dc208ece5f",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:80ecb87cae9c44d19824e70ea7229748"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4cede189a43c349069c614e305683720
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,14 @@
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
namespace Darkmatter.Features.Coloring
{
public class ColoringFeatureModule : MonoBehaviour,IModule
{
public void Register(IContainerBuilder builder)
{
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
using Darkmatter.Core.Contracts.Services.Audio;
using Darkmatter.Core.Data.Static.Services.Audio;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
namespace Darkmatter.Services.Audio
{
public class AudioServiceModule : MonoBehaviour, IModule
{
[SerializeField] private SfxCatalogSO sfxCatalog;
public void Register(IContainerBuilder builder)
{
if (sfxCatalog != null)
builder.RegisterComponent(sfxCatalog);
builder.Register<IAudioService, AudioService>(Lifetime.Singleton);
builder.Register<ISfxPlayer, SfxPlayer>(Lifetime.Singleton);
}
}
}

View File

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

View File

@@ -5,7 +5,8 @@
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:b4c9f7fbf1e144933a1797dc208ece5f"
"GUID:b4c9f7fbf1e144933a1797dc208ece5f",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

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

View File

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

View File

@@ -0,0 +1,15 @@
using Darkmatter.Core.Contracts.Services.Scenes;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
namespace Darkmatter.Services.Scenes
{
public class SceneServiceModule : MonoBehaviour, IModule
{
public void Register(IContainerBuilder builder)
{
builder.Register<ISceneService, SceneService>(Lifetime.Singleton);
}
}
}

View File

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

View File

@@ -6,7 +6,9 @@
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:593a5b492d29ac6448b1ebf7f035ef33",
"GUID:9e24947de15b9834991c9d8411ea37cf",
"GUID:84651a3751eca9349aac36a66bba901b"
"GUID:84651a3751eca9349aac36a66bba901b",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc"
],
"includePlatforms": [],
"excludePlatforms": [],

View File

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