[Add] Game Loop Playable
This commit is contained in:
@@ -17,17 +17,18 @@ namespace YachtDice.Shop
|
||||
private readonly List<ShopItemView> _spawnedItems = new();
|
||||
|
||||
public event Action<IShopItem> OnBuyClicked;
|
||||
public event Action OnCloseRequested;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (closeButton != null)
|
||||
closeButton.onClick.AddListener(Hide);
|
||||
closeButton.onClick.AddListener(HandleCloseClicked);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (closeButton != null)
|
||||
closeButton.onClick.RemoveListener(Hide);
|
||||
closeButton.onClick.RemoveListener(HandleCloseClicked);
|
||||
}
|
||||
|
||||
public void Show() => gameObject.SetActive(true);
|
||||
@@ -92,5 +93,10 @@ namespace YachtDice.Shop
|
||||
if (tooltipView != null)
|
||||
tooltipView.Hide();
|
||||
}
|
||||
|
||||
private void HandleCloseClicked()
|
||||
{
|
||||
OnCloseRequested?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user