Esempio n. 1
0
    void ApplyNote(InGameNote ign, bool error = false)
    {
        _currentValue += !error?
                         _comboReceiver.FirstOrDefault(i => i.Rank == ign.CurrentRank)?.Score ?? 0 :
                         _comboReceiver.First(i => i.Rank == ValidationRank.Error).Score;

        if (_currentValue > CurrentCoef.MaxScore)
        {
            _currentValue -= CurrentCoef.MaxScore;
            _currentIndex  = Mathf.Min(_currentIndex + 1, _comboLevels.Length - 1);
        }
        else if (_currentValue < 0)
        {
            if (_currentIndex == 0)
            {
                _currentValue = 0;
            }
            else
            {
                _currentIndex--;
                _currentValue = CurrentCoef.MaxScore + _currentValue;
            }
        }

        UpdateUI();
    }
Esempio n. 2
0
    public void ScoreUp(InGameNote note)
    {
        if (note.CurrentRank == ValidationRank.Error)
        {
            return;
        }

        _currentResumeScore.First(i => i.Rank == note.CurrentRank).CurrentCount++;

        _currentScore += _scoreConf.First(i => i.Rank == note.CurrentRank).Score *_combo.CurrentCoef.Coef;
        _text.text     = _currentScore.ToString();
        OnScoreUp?.Invoke(note);
        OnNoteAccepted?.Invoke();
    }
    void UpdateAnimator(InGameNote ign)
    {
        var correctTrigger = _triggers.FirstOrDefault(i => i.Rank == ign.CurrentRank);

        _animator.SetTrigger(correctTrigger.TriggerName);
    }
Esempio n. 4
0
 public void NoteMissed(InGameNote ign)
 {
     _missedNotes++;
     OnScoreUp?.Invoke(ign);
     OnNoteMissed?.Invoke();
 }
Esempio n. 5
0
 void ApplyNote(InGameNote ign) => ApplyNote(ign, false);
Esempio n. 6
0
 void MissedNote(InGameNote ign)
 {
     ApplyNote(ign, true);
 }