Beispiel #1
0
 public Piece(Note note, PieceData data, int stepOffset)
 {
     this.note       = note;
     _data           = data;
     this.stepOffset = stepOffset;
     position        = new Vector2(data.positionX, GridUtility.StepToPositionY(stepOffset + 16 - note.grid.stepOffset));
 }
Beispiel #2
0
        public void ShowBeatingResult()
        {
            BeatingResultView beatingResultView = GridUtility.SpawnBeatingResultView(piece.beatingResult);

            beatingResultView.Initialize(GridView.instance.anchor.ToWorldPosition(piece.position));
            Destroy();
        }
Beispiel #3
0
        public Note(Grid grid, NoteData data, int stepOffset)
        {
            this.grid       = grid;
            _data           = data;
            this.stepOffset = stepOffset;
            position        = new Vector2(_data.pieces[0].positionX, GridUtility.StepToPositionY(stepOffset + 16 - grid.stepOffset));
            direction       = GridUtility.StepToDirection(stepOffset + 16 - grid.stepOffset);
            int   pieceStepOffset = stepOffset;
            Piece previousPiece   = null;

            foreach (var pieceData in _data.pieces)
            {
                Piece piece;
                switch (data.beatingStyle)
                {
                case BeatingStyleType.Click:
                    piece = new ClickPiece(this, pieceData, pieceStepOffset);
                    break;

                case BeatingStyleType.Hold:
                    piece = new HoldPiece(this, pieceData, pieceStepOffset);
                    break;

                case BeatingStyleType.SpecialHold:
                    piece = new SpecialHoldPiece(this, pieceData, pieceStepOffset);
                    break;

                case BeatingStyleType.Drag:
                    piece = new DragPiece(this, pieceData, pieceStepOffset);
                    break;

                case BeatingStyleType.Flick:
                    piece = new FlickPiece(this, pieceData, pieceStepOffset);
                    break;

                default:
                    throw new Exception();
                }
                if (previousPiece != null)
                {
                    piece.previous     = previousPiece;
                    previousPiece.next = piece;
                }
                pieceStepOffset += piece.tempo;
                _pendingPieces.Enqueue(piece);
                previousPiece = piece;
            }
        }
Beispiel #4
0
        public void ShowBeatingResult()
        {
            BeatingResultView beatingResultView = GridUtility.SpawnBeatingResultView(piece.beatingResult);

            beatingResultView.Initialize(GridView.instance.anchor.ToWorldPosition(piece.position));
            if (piece.previous != null)
            {
                if (_tempo.gameObject.activeSelf)
                {
                    _icon.SetActive(false);
                }
                else
                {
                    Destroy();
                }
            }
        }
Beispiel #5
0
        public void ShowBeatingResult()
        {
            BeatingResultView beatingResultView = GridUtility.SpawnBeatingResultView(piece.beatingResult);

            switch (piece.beatingResult)
            {
            case BeatingResultType.Good:
            case BeatingResultType.Perfect:
            case BeatingResultType.Bad:
                beatingResultView.Initialize(new Vector3(GridView.instance.anchor.ToWorldPosition(piece.position).x, GridView.instance.scanLinePosition.y));
                break;

            case BeatingResultType.Miss:
                beatingResultView.Initialize(GridView.instance.anchor.ToWorldPosition(piece.position));
                break;

            default:
                throw new Exception();
            }
            Destroy();
        }