//ピースがマッチしているかを判定 private bool IsMatchPiece(PieceManager piece) { var pos = GetPieceBoardPos(piece); var kind = piece.GetColor(); var verticalMatchCount = GetSameKindPieceNum(kind, pos, Vector2.up) + GetSameKindPieceNum(kind, pos, Vector2.down) + 1; var horizontalMatchCount = GetSameKindPieceNum(kind, pos, Vector2.right) + GetSameKindPieceNum(kind, pos, Vector2.left) + 1; return(verticalMatchCount >= GameManager.MachingCount || horizontalMatchCount >= GameManager.MachingCount); }