Intro done and bug fix

This commit is contained in:
Savya Bikram Shah
2026-05-28 14:19:06 +05:45
parent b38f4d592c
commit e0e7601c27
15 changed files with 556 additions and 19 deletions

View File

@@ -1,11 +1,6 @@
using VContainer;
namespace Darkmatter.App.LifetimeScopes
{
public class GameLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}
}
}

View File

@@ -1,11 +1,6 @@
using VContainer;
namespace Darkmatter.App.LifetimeScopes
{
public class RootLifetimeScope : BaseLifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
}
}
}
}

View File

@@ -1,3 +1,19 @@
{
"name": "Features.AppBoot"
}
"name": "Features.AppBoot",
"rootNamespace": "Darkmatter.Features.AppBoot",
"references": [
"GUID:6a0a834eb41764f12ba55c3fb04a40cb",
"GUID:c1c03c0e5b2f4412b9f2be1c20d6a9b1",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

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

View File

@@ -0,0 +1,44 @@
using System.Threading;
using Cysharp.Threading.Tasks;
using Darkmatter.Features.AppBoot.SceneRefs;
using UnityEngine;
using UnityEngine.Video;
using VContainer.Unity;
namespace Darkmatter.Features.AppBoot.Flow
{
public class AppBootFlow : IAsyncStartable
{
private readonly AppBootSceneRefs _sceneRefs;
public AppBootFlow(AppBootSceneRefs sceneRefs)
{
_sceneRefs = sceneRefs;
}
public async UniTask StartAsync(CancellationToken cancellation = default)
{
var tcs = new UniTaskCompletionSource();
var player = _sceneRefs.IntroVideoPlayer;
void OnDone(VideoPlayer vp)
{
vp.loopPointReached -= OnDone;
tcs.TrySetResult();
}
player.loopPointReached += OnDone;
player.Play();
await tcs.Task.AttachExternalCancellation(cancellation);
player.Stop();
var rt = player.targetTexture;
if (rt != null) rt.Release();
if (_sceneRefs.IntroCanvas != null)
Object.Destroy(_sceneRefs.IntroCanvas.gameObject);
Object.Destroy(player.gameObject);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 892f636e24e0d41ce9423c7a989d717b

View File

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

View File

@@ -0,0 +1,21 @@
using Darkmatter.Features.AppBoot.Flow;
using Darkmatter.Features.AppBoot.SceneRefs;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;
namespace Darkmatter.Features.AppBoot.Installers
{
public class AppBootFeatureModule : MonoBehaviour, IModule
{
[SerializeField] private AppBootSceneRefs sceneRefs;
public void Register(IContainerBuilder builder)
{
if (sceneRefs != null)
builder.RegisterComponent(sceneRefs);
builder.RegisterEntryPoint<AppBootFlow>();
}
}
}

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 016a2252ff404eea98e7a84b80d0e4b1
timeCreated: 1779955116

View File

@@ -0,0 +1,11 @@
using UnityEngine;
using UnityEngine.Video;
namespace Darkmatter.Features.AppBoot.SceneRefs
{
public class AppBootSceneRefs : MonoBehaviour
{
[field: SerializeField] public VideoPlayer IntroVideoPlayer { get; private set; }
[field: SerializeField] public GameObject IntroCanvas { get; private set; }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 17fd08f85ba94bf694f285cdd48bee02
timeCreated: 1779955127