Ejemplo n.º 1
0
 void Start()
 {
     button = GetComponent <Button>();
     mysteryBoxInventory = FindObjectOfType <MysteryBoxInventory>();
     button.interactable = mysteryBoxInventory.Owned > 0;
     EventBroker.Instance().SubscribeMessage <EventMysteryBoxBought>(ShouldBeActive);
 }
Ejemplo n.º 2
0
        IEnumerator Start()
        {
            yield return(new WaitForSeconds(3f));

            mysteryBoxInventory = FindObjectOfType <MysteryBoxInventory>();
            var amount = mysteryBoxInventory.Owned;

            amountText.text = amount > 0 ? $"{amount}" : " ";
            EventBroker.Instance().SubscribeMessage <EventMysteryBoxBought>(OnLootBoxPurchased);
            EventBroker.Instance().SubscribeMessage <EventMysteryBoxOpened>(OnLootBoxOpened);
        }