Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Game.MVP.Core.Scenes;
Expand Down Expand Up @@ -40,6 +41,13 @@ protected override void OnDestroy()
{
_onOptionSelected.Dispose();
_onCloseClicked.Dispose();

foreach (var sprite in _iconCache.Values)
{
_assetService.ReleaseAsset(sprite);
}
_iconCache.Clear();

base.OnDestroy();
}

Expand Down Expand Up @@ -225,8 +233,9 @@ private async UniTaskVoid LoadIconAsync(string iconAssetName, VisualElement thum
thumbnail?.AddToClassList("option__thumbnail--empty");
}
}
catch
catch (Exception ex)
{
Debug.LogWarning($"[LevelUpDialog] Failed to load icon '{iconAssetName}': {ex.Message}");
// エラー時はプレースホルダーを表示
thumbnail?.RemoveFromClassList("option__thumbnail--loading");
thumbnail?.AddToClassList("option__thumbnail--empty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public class SurvivorStageSceneComponent : GameSceneComponent
private float _timeLimit = 0f;
private int _totalWaves = 1;

private const int WaveBannerDisplayDurationMs = 2500;
private const int WaveBannerFadeOutDurationMs = 300;

protected override void OnDestroy()
{
_bannerCts?.Cancel();
Expand Down Expand Up @@ -139,6 +142,12 @@ protected override void OnDestroy()
_flashCtsMap.Clear();
_weaponCards.Clear();

foreach (var sprite in _iconCache.Values)
{
_assetService.ReleaseAsset(sprite);
}
_iconCache.Clear();

base.OnDestroy();
}

Expand Down Expand Up @@ -442,14 +451,14 @@ private async UniTaskVoid HideBannerAfterDelayAsync(CancellationToken ct)
{
try
{
await UniTask.Delay(2500, cancellationToken: ct);
await UniTask.Delay(WaveBannerDisplayDurationMs, cancellationToken: ct);

if (_waveBanner != null)
{
_waveBanner.AddToClassList("wave-banner--fade-out");
}

await UniTask.Delay(300, cancellationToken: ct);
await UniTask.Delay(WaveBannerFadeOutDurationMs, cancellationToken: ct);

if (_waveBanner != null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Cysharp.Threading.Tasks;
using Game.Library.Shared.Enums;
using Game.MVP.Core.Scenes;
Expand Down Expand Up @@ -106,26 +107,38 @@ private async UniTask SubmitScoresAsync(SurvivorStageSession session)

foreach (var result in session.StageResults)
{
var request = _viewModel.BuildScoreRequest(result, session.CurrentWave);

// オンライン時は即座に送信を試行
if (_networkService.IsConnected)
try
{
var response = await _scoreApiService.SubmitScoreAsync(request);
if (response.IsSuccess)
var request = _viewModel.BuildScoreRequest(result, session.CurrentWave);

// オンライン時は即座に送信を試行
if (_networkService.IsConnected)
{
if (response.Data?.IsNewBest == true)
var response = await _scoreApiService.SubmitScoreAsync(request);
if (response.IsSuccess)
{
SceneComponent.ShowNewBestEffect(result.StageId, response.Data.CurrentRank);
if (response.Data?.IsNewBest == true)
{
SceneComponent.ShowNewBestEffect(result.StageId, response.Data.CurrentRank);
}
continue;
}
continue;
}
}

// オフラインまたは失敗時はキューに追加
await _scoreApiService.EnqueueSubmitScoreAsync(request);

SceneComponent.ShowScoreQueuedNotice(result.StageId);
// オフラインまたは失敗時はキューに追加
await _scoreApiService.EnqueueSubmitScoreAsync(request);
SceneComponent.ShowScoreQueuedNotice(result.StageId);
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception ex)
{
UnityEngine.Debug.LogError(
$"[SurvivorTotalResultScene] Failed to submit score for stage {result.StageId}: {ex.Message}");
SceneComponent.ShowScoreQueuedNotice(result.StageId);
}
}

SceneComponent.HideScoreSubmissionStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ protected override void OnDestroy()
{
_onWeaponSelected.Dispose();
_onCancelClicked.Dispose();

foreach (var sprite in _iconCache.Values)
{
_assetService.ReleaseAsset(sprite);
}
_iconCache.Clear();

base.OnDestroy();
}

Expand Down
Loading