Exemple #1
0
    //キー入力
    public bool hit(KeyCode aKey, float aSecond, Note.HitNoteType aType)
    {
        int tLength = (mTriplet) ? 3 : 4;

        for (int i = 0; i < tLength; i++)
        {
            if (mNotes[i] == null)
            {
                continue;                   //音符なし
            }
            float tSecond = MusicScoreData.quarterBeatToMusicTime(mNotes[i].mCorrectQuarterBeat);
            TypeEvaluation.Evaluation tEvaluation = TypeEvaluation.evaluate(aSecond, tSecond);
            if (tEvaluation == TypeEvaluation.Evaluation.miss)
            {
                continue;                                               //タイミングがあってない
            }
            //タイミングOK
            Note.HitResult tHitResult = mNotes[i].hit(aKey, aType);
            if (tHitResult == Note.HitResult.miss)
            {
                continue;                                   //hitしなかった
            }
            //hitしたメッセージ送信
            Subject.sendMessage(new Message("hittedNote", new Arg(new Dictionary <string, object>()
            {
                { "note", mNotes[i] },
                { "evaluation", tEvaluation },
                { "difference", aSecond - tSecond },
                { "hitResult", tHitResult }
            })));
            return(true);
        }
        return(false);
    }
Exemple #2
0
 //キー入力
 public bool hit(KeyCode aKey, float aSecond, Note.HitNoteType aType)
 {
     foreach (Beat tBeat in mBeats)
     {
         if (tBeat.hit(aKey, aSecond, aType))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #3
0
 //キー入力
 public bool hit(KeyCode aKey, float aSecond, Note.HitNoteType aType, string aHitSound, string aMissSound)
 {
     if (mScore.hit(aKey, aSecond, Note.HitNoteType.delete))
     {
         //hit
         if (aHitSound != "")
         {
             SoundPlayer.playSe(aHitSound);
         }
         return(true);
     }
     else
     {
         //miss
         if (aMissSound != "")
         {
             SoundPlayer.playSe(aMissSound);
         }
         return(false);
     }
 }