fixes
This commit is contained in:
@@ -58,7 +58,7 @@ MonoBehaviour:
|
||||
m_ContentStateBuildPathProfileVariableName:
|
||||
m_CustomContentStateBuildPath:
|
||||
m_ContentStateBuildPath:
|
||||
m_BuildAddressablesWithPlayerBuild: 0
|
||||
m_BuildAddressablesWithPlayerBuild: 1
|
||||
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
|
||||
m_GroupAssets:
|
||||
- {fileID: 11400000, guid: ec9d910e81be14a1484f351f20d32f6f, type: 2}
|
||||
|
||||
@@ -89,6 +89,7 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
|
||||
|
||||
private void OnDrawingSelected(DrawingSelectedSignal signal)
|
||||
{
|
||||
if (_navigatingToGameplay) return;
|
||||
_navigatingToGameplay = true;
|
||||
HandleSelectionAsync(signal.TemplateId).Forget();
|
||||
}
|
||||
@@ -97,9 +98,11 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
|
||||
{
|
||||
var ct = _scopeCts?.Token ?? CancellationToken.None;
|
||||
|
||||
_loadingScreen.Show();
|
||||
_loadingScreen.SetProgress(0f);
|
||||
|
||||
await ShowRewardedAdAsync(ct);
|
||||
|
||||
_loadingScreen.Show();
|
||||
var progress = new Progress<float>(p => _loadingScreen.SetProgress(p * 0.5f));
|
||||
var mappedProgress = new Progress<float>(p => _loadingScreen.SetProgress(0.5f + p * 0.25f));
|
||||
await _progression.SetLastOpenedAsync(templateId);
|
||||
@@ -110,15 +113,24 @@ public class ColorbookFlowController : IAsyncStartable, IDisposable
|
||||
|
||||
private async UniTask ShowRewardedAdAsync(CancellationToken ct)
|
||||
{
|
||||
const int InitTimeoutMs = 4000;
|
||||
try
|
||||
{
|
||||
if (!_ads.IsInitialized) await _ads.InitializeAsync(ct);
|
||||
if (!_ads.IsInitialized)
|
||||
{
|
||||
using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
|
||||
timeoutCts.CancelAfter(InitTimeoutMs);
|
||||
await _ads.InitializeAsync(timeoutCts.Token);
|
||||
}
|
||||
|
||||
if (!_ads.IsReady(AdFormat.Rewarded)) return;
|
||||
|
||||
await _ads.ShowAsync(AdFormat.Rewarded, ct);
|
||||
}
|
||||
catch (OperationCanceledException) { }
|
||||
catch (Exception ex)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning($"[ColorbookFlow] Rewarded ad failed: {ex.Message}");
|
||||
UnityEngine.Debug.LogWarning($"[ColorbookFlow] Rewarded ad skipped: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user