public void Init(int showCoinNumber, Action action)
 {
     this.showCoinNumber = showCoinNumber;
     callback            = action;
     _chestItem.Init(showCoinNumber, callback);
     showChestDialog.SetActive(true);
 }
示例#2
0
    //=====================================================

    private void SetRewardItem(eSwitchItem switchItem,
                               eTradingCardClassification cardClassification,
                               eTradingCardRarity cardRarity,
                               eTradingCardCondition cardCondition)
    {
        if (switchItem == eSwitchItem.NULL)
        {
            // Reset reward to gems or a card
            _reward = SceneManager.GetChestReward(_type, cardClassification, cardRarity, cardCondition);
        }
        else
        {
            if (_reward == null)
            {
                _reward = new ChestReward();
            }

            // Clear other reward items if switchItem is set
            _reward.Gems       = 0;
            _reward.Card       = null;
            _reward.SwitchItem = switchItem;
        }
        //Debug.Log( "Chest: " + _type + " : " + _reward );

        // Initialise chest switchItem as reward
        if (_chestReward != null && _reward != null)
        {
            _chestReward.Init(_reward);
        }
    }