Skip to content

Commit e23994b

Browse files
committed
Delegate SettingsWindowView.Show to Presenter
Add UniTask import and delegate the view's Show() to SettingsPresenter by overriding Show() to call RequestShow().Forget(). Subscribe to SettingsPresenter.OnShowRequested to invoke base.Show() (with disposal), ensuring the presenter creates the settings UI before the view runs its animation/actual show.
1 parent 12b8513 commit e23994b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Assets/Scripts/UI/Views/Settings/SettingsWindowView.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Cysharp.Threading.Tasks;
12
using R3;
23
using UnityEngine;
34
using Void2610.SettingsSystem;
@@ -12,6 +13,12 @@ public class SettingsWindowView : BaseWindowView
1213

1314
private SettingsPresenter _settingsPresenter;
1415

16+
/// <summary>
17+
/// 表示処理をPresenterに委譲する。Presenterが設定UIを生成してからOnShowRequestedを発火し、
18+
/// その購読側で実際のアニメーション付きShowが実行される
19+
/// </summary>
20+
public override void Show() => _settingsPresenter.RequestShow().Forget();
21+
1522
/// <summary>
1623
/// 初期化
1724
/// </summary>
@@ -35,6 +42,11 @@ public void Initialize(SettingsPresenter settingsPresenter, InputActionsProvider
3542
.AddTo(Disposables);
3643
}
3744

45+
// Presenterが設定UI生成完了を通知 → 実際のアニメーション付き表示
46+
_settingsPresenter.OnShowRequested
47+
.Subscribe(_ => base.Show())
48+
.AddTo(Disposables);
49+
3850
// 閉じるボタン(SettingsPresenter経由)
3951
_settingsPresenter.OnHideRequested
4052
.Subscribe(_ => Hide())

0 commit comments

Comments
 (0)