示例#1
0
 public static Note getCurrentNote(GD type)
 {
     for (int i = 0; i < maxSearch; i++)
     {
         Note note = NotesToPlay[notePosition + i];
         if (GDMethods.getBeatType(note.instrumentName) == type)
         {
             return(note);
         }
     }
     return(null);
 }
示例#2
0
    public static void checkBeats(float time)
    {
        if (NotesToPlay != null)
        {
            while (notePosition < NotesToPlay.Count && NotesToPlay[notePosition].startTime <= time)
            {
                Note note     = NotesToPlay[notePosition];
                GD   noteType = GDMethods.getBeatType(note.instrumentName);

                float interp = (float)(time - note.startTime) / 1000;

                if (note.durationTime >= GameManager.durationForHold)
                {
                    callBeat(noteType, interp, (float)note.durationTime);
                }
                else
                {
                    callBeat(noteType, interp);
                }
                notePosition++;
            }

            while (noteBarPosition < NotesToPlay.Count && NotesToPlay[noteBarPosition].startTime <= (time + 4500f))
            {
                //Debug.Log ("" + noteBarPosition + ":" + NotesToPlay[noteBarPosition].startTime);
                Note note     = NotesToPlay[noteBarPosition];
                GD   noteType = GDMethods.getBeatType(note.instrumentName);

                float interp = (float)(time + 4500f - note.startTime) / 1000;
                callNoteBarBeat(noteType, interp);
                noteBarPosition++;
            }
        }

        if (notePosition >= NotesToPlay.Count)
        {
            delayToScores -= Time.deltaTime;

            if (delayToScores <= 0)
            {
                GameManager.endLevel();
            }
        }
    }