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)); }
public void ShowBeatingResult() { BeatingResultView beatingResultView = GridUtility.SpawnBeatingResultView(piece.beatingResult); beatingResultView.Initialize(GridView.instance.anchor.ToWorldPosition(piece.position)); Destroy(); }
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; } }
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(); } } }
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(); }