Exemplo n.º 1
0
    public void AcceptNote(Note n)
    {
        ClosebyNote toAdd = new ClosebyNote();

        toAdd.timing = -1 * timingWindows[0].msDelay;
        toAdd.note   = n;
        notesInWindow.Add(toAdd);
    }
Exemplo n.º 2
0
    public void AcceptInput(KeybindManager.InputAction action)
    {
        if (!KeybindManager.IsRowHit(action) || PauseManager.currentState != PauseManager.State.Gameplay)
        {
            return;
        }

        int         row         = KeybindManager.GetRow(action);
        NoteType    nType       = KeybindManager.GetType(action);
        ClosebyNote closestNote = null;

        foreach (ClosebyNote note in notesInWindow)
        {
            if (note.note.lane == row &&
                note.note.type == nType &&
                (closestNote == null || Mathf.Abs(note.timing) < Mathf.Abs(closestNote.timing)))
            {
                closestNote = note;
            }
        }
        if (closestNote == null)
        {
            HitsoundManager.instance.PlaySound(SoundType.Normal, false);
            return;
        }
        ScoreManager.instance.totalAccuracy += closestNote.timing;
        ScoreManager.instance.notesHit      += 1;
        Window last = timingWindows[0];

        for (int i = 1; i < timingWindows.Count; ++i)
        {
            if (Mathf.Abs(closestNote.timing) > Mathf.Abs(timingWindows[i].msDelay))
            {
                TriggerWindow(last, closestNote);
                return;
            }
            last = timingWindows[i];
        }
        TriggerWindow(last, closestNote);
        return;
    }
Exemplo n.º 3
0
 private void TriggerWindow(Window w, ClosebyNote note)
 {
     ScoreManager.instance.score += w.pointValue * ScoreManager.instance.GetComboScale();
     ScoreManager.instance.HitName(w.name, w.color);
     if (w.breaksCombo)
     {
         ScoreManager.instance.combo = 0;
         if (DeathHandler.instance != null)
         {
             DeathHandler.instance.OnMiss();
         }
     }
     else
     {
         ScoreManager.instance.combo++;
     }
     HitsoundManager.instance.PlaySound(note.note.soundType);
     if (note.note.rendered != null)
     {
         note.note.rendered.HitNote();
     }
     notesInWindow.Remove(note);
 }