Ejemplo n.º 1
0
    public void InitBarByScore(int pieceIndex, int barIndex, UIBar uiBar)
    {
        uiBar.startBeat = occupiedBeats;

        //QTE BAR
        if (QTEbarIndex >= 0)
        {
            uiBar.type = UIBar.barType.QTEBar;

            uiBar.ReadScore(QTEscore.QTEscore[QTEbarIndex].notes);
            uiBar.beatsThisBar = QTEscore.QTEscore[QTEbarIndex].beatsThisBar;
        }
        if (QTEbarIndex < 0)
        {
            uiBar.type = UIBar.barType.inputBar;

            //判断当前所在的段落,读取单小节乐谱
            OneBarScore _barScore = pieceIndex > 0 ? score.mainlude[barIndex] : score.prelude[barIndex];

            uiBar.ReadScore(_barScore.notes);
            uiBar.beatsThisBar = _barScore.beatsThisBar;
        }

        //        Debug.Log("startbeat=" + uiBar.startBeat);
//    Debug.Log("occupiedBeats=" + occupiedBeats);

        uiBar.Init();
        uiBar.GetComponent <UIBar>().SetPinAlpha(0);
        uiBar.GetComponent <UIBar>().active = true;

        currentEnergyNotes.AddRange(uiBar.GetComponent <UIBar>().noteList_energy);
        currentQTENotes.AddRange(uiBar.GetComponent <UIBar>().noteList_QTE);
        occupiedBeats += uiBar.beatsThisBar;
    }
Ejemplo n.º 2
0
 //普通BAR转换为QTEBAR,用于QTE触发
 public void TurnBarIntoQTE(UIBar uIBar, List <Note> notes)
 {
     uIBar.type      = UIBar.barType.QTEBar;
     uIBar.bg.sprite = uIBar.bgQTE;
     //清除普通阶段的遗留音符
     currentEnergyNotes.Clear();
     InputSequenceController.Instance.CurInputSequence.Clear();
     uIBar.Empty();
     uIBar.InitLines();
     uIBar.ReadScore(notes);
     uIBar.InitNotes();
     currentQTENotes.AddRange(uIBar.GetComponent <UIBar>().noteList_QTE);
 }