46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ChestRewardSelection : MonoBehaviour
|
|
{
|
|
public static event Action DiamondAndLifeSelected;
|
|
public static event Action TorchAbilitySelected;
|
|
public static event Action BlackDiceAbilitySelected;
|
|
|
|
public event Action ArmorAndDiamondNoLongerAvailable;
|
|
public event Action TorchNoLongerAvailable;
|
|
public event Action BlackDieNoLongerAvailable;
|
|
public event Action DisplayChestReward;
|
|
|
|
private void OnEnable()
|
|
{
|
|
RoomRewards.ChestRewarded += HandChestRewarded;
|
|
}
|
|
|
|
private void HandChestRewarded()
|
|
{
|
|
DisplayChestReward?.Invoke();
|
|
}
|
|
|
|
public void HandleDiamondAndLifeSelected()
|
|
{
|
|
ArmorAndDiamondNoLongerAvailable?.Invoke();
|
|
DiamondAndLifeSelected?.Invoke();
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
public void HandleTorchSelected()
|
|
{
|
|
TorchNoLongerAvailable?.Invoke();
|
|
TorchAbilitySelected?.Invoke();
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
public void HandleBlackDiceSelected()
|
|
{
|
|
BlackDieNoLongerAvailable?.Invoke();
|
|
BlackDiceAbilitySelected?.Invoke();
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|