//检测是否有击中音符对象 //如果是,它将执行命中并删除 public void CheckNoteHit() { if (!gameController.gameStart) { CreateDownEffect(); return; } if (trackedNotes.Count > 0) { NoteObject noteObject = trackedNotes.Peek(); if (noteObject.hitOffset > -6000) { trackedNotes.Dequeue(); int hitLevel = noteObject.IsNoteHittable(); gameController.ChangeHitLevelSprite(hitLevel); if (hitLevel > 0) { //更新分数 gameController.UpdateScoreText(100 * hitLevel); if (noteObject.isLongNote) { hasLongNote = true; CreateHitLongEffect(); } else if (noteObject.isLongNoteEnd) { hasLongNote = false; } else { CreateHitEffect(); } //增加连接数 gameController.comboNum++; } else { //未击中 //减少玩家HP gameController.UpdateHP(); //断掉玩家命中连接数 gameController.HideComboNumText(); gameController.comboNum = 0; } noteObject.OnHit(); } else { CreateDownEffect(); } } else { CreateDownEffect(); } }