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(); }
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); }
public void NoteMissed(InGameNote ign) { _missedNotes++; OnScoreUp?.Invoke(ign); OnNoteMissed?.Invoke(); }
void ApplyNote(InGameNote ign) => ApplyNote(ign, false);
void MissedNote(InGameNote ign) { ApplyNote(ign, true); }