コード例 #1
0
    public void Collect(int hours)
    {
        if (IsBonusReady)
        {
            IsBonusReady = false;
            var config = _bonusesConfig.GetBonuses.First(b => b.Hours == hours);
            _progressController.AddCrystals(config.Reward);

            OnRewardCollected?.Invoke();
        }
    }
コード例 #2
0
    public void CollectReward()
    {
        if (IsCurrentQuestsCompleted)
        {
            _progressController.AddCrystals(GetCurrentQuests.Reward);

            ++_currentQuestIndex;
            var count = _questsConfig.GetQuests.Count();

            if (_currentQuestIndex >= count)
            {
                _currentQuestIndex = count - 1;
            }

            OnRewardCollected?.Invoke();
        }
    }