savya #14

Merged
savya merged 108 commits from savya into main 2026-07-07 09:55:51 +02:00
Showing only changes of commit f81a17e1f5 - Show all commits

View File

@@ -50,12 +50,21 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
public async UniTask StartAsync(CancellationToken cancellation = new CancellationToken())
{
_scopeCts = CancellationTokenSource.CreateLinkedTokenSource(cancellation);
// Grab the token value up front. If the scope is torn down (scene unload) while the
// init below is in flight, the await resumes during disposal — when _scopeCts is already
// disposed and its .Token getter would throw ObjectDisposedException. The captured struct
// stays safe to read.
var ct = _scopeCts.Token;
_returnToMainMenuSubscription = _bus.Subscribe<ReturnToMainMenuSignal>(OnReturnToMainMenu);
_loadingScreen.SetProgress(1f);
await _drawingCatalog.InitializeAsync(cancellation);
await _drawingCatalog.InitializeAsync(ct);
// scope disposed mid-init; nothing left to do. Check the external token too — it's the
// one VContainer cancels on teardown, and the linked _scopeCts may lag the callback order.
if (cancellation.IsCancellationRequested || ct.IsCancellationRequested) return;
if (!_navigatingToGameplay) _loadingScreen.Hide();
PrewarmInterstitialAdAsync(_scopeCts.Token).Forget();
PrewarmInterstitialAdAsync(ct).Forget();
}
private async UniTaskVoid PrewarmInterstitialAdAsync(CancellationToken ct)