[Add] Game Loop Playable

This commit is contained in:
2026-03-28 12:53:34 +07:00
parent 78ad76120f
commit f2173d2c73
20 changed files with 1433 additions and 122 deletions
+10
View File
@@ -13,6 +13,7 @@ namespace YachtDice.Shop
private ShopModel _model;
public ShopCatalog Catalog => _catalog;
public event System.Action OnCloseRequested;
[Inject]
public void Construct(ShopCatalog catalog, CurrencyBank currencyBank, ShopModel model)
@@ -25,6 +26,7 @@ namespace YachtDice.Shop
private void Start()
{
shopView.OnBuyClicked += HandleBuyClicked;
shopView.OnCloseRequested += HandleCloseRequested;
_currencyBank.OnBalanceChanged += HandleCurrencyChanged;
_model.OnItemPurchased += HandleItemPurchased;
@@ -35,7 +37,10 @@ namespace YachtDice.Shop
private void OnDestroy()
{
if (shopView != null)
{
shopView.OnBuyClicked -= HandleBuyClicked;
shopView.OnCloseRequested -= HandleCloseRequested;
}
if (_currencyBank != null)
_currencyBank.OnBalanceChanged -= HandleCurrencyChanged;
@@ -83,5 +88,10 @@ namespace YachtDice.Shop
{
shopView.RefreshStates(_catalog.All, _model);
}
private void HandleCloseRequested()
{
OnCloseRequested?.Invoke();
}
}
}