Start new round after checking neighbors C#

In the game I’m working on, I want a new round to start when the player has 5 or less blocks that do not have matching neighbors. I already have a function that calls and checks for neighbors, but it doesn’t initialize a new round. Do I need to do this in a new function or in the same function that checks for neighbors? I’ll post my code here for my neighbor calling function and hopefully you all can add some assistance and help me progress!

#region Find Neighbors
		public bool findNeighbor(GameObject clickedBlock) {
			
			Vector2 neighborPos = GetBlockPos(clickedBlock);
			bool foundNeighbor = false;
			
			if (neighborPos != new Vector2(-1,-1)) {
				
				Texture texType = clickedBlock.renderer.material.mainTexture;
				
				// Search for neighbor blocks going up
				if (neighborPos.y > 0) {
					if (grid[(int)neighborPos.x,(int)neighborPos.y-1].renderer.material.mainTexture == texType) {
						foundNeighbor = true;	
					}
				}
				// Search for neighbor blocks going right
				if (neighborPos.x > 0) {
					if (grid[(int)neighborPos.x-1,(int)neighborPos.y].renderer.material.mainTexture == texType) {
						foundNeighbor = true;
					}
				}
				
				// Search for neighbor blocks going down
				if (neighborPos.y < grid.GetLength(1)-1) {
					if (grid[(int)neighborPos.x,(int)neighborPos.y+1].renderer.material.mainTexture == texType) {
						foundNeighbor = true;
					}
				}
				// Search for neighbor blocks going left
				if (neighborPos.x < grid.GetLength (1)-1) {
					if (grid[(int)neighborPos.x+1,(int)neighborPos.y].renderer.material.mainTexture == texType) {
						foundNeighbor = true;
					}
				}
				return foundNeighbor;
			} else { 
				Debug.LogError ("NO BLOCKS WERE FOUND");
				//New round here?
				return false;

			}
		}
		#endregion

		#region checkForRoundEnd
		public bool checkForRoundEnd(GameObject clickedBlock) {
			Vector2 neighborBlocks = GetBlockPos(clickedBlock);
			bool newNeighbor = false;
			//Check for neighbors or count how many blocks are left
			//If there are less than 5 blocks or no neighbors start a new round

		}
		#endregion

From the start of what you’ve posted passing a parameter clickedBlock it will have nothing to do with what you’ve posted in there.

Somewhere else in your code you’ll have whatever code does something after the player has made a move, once this has been completed then you’ll need to check whether there’s any possible moves left (or less than 5 blocks).

Simply put after your players move code

movesAvailable = false;
for each block left in the game { //<-this is only pseudo
  if findNeighbor(block){
    movesAvailable = true;
  }
}
if(movesAvailable == false){
  //do restart code
}

Ideally keep this is a separate function as mentioned by mattyman.

You should break it off into a new Function. Splitting code into meaningful methods is good practice as it helps with code management and debugging among other things. Only break up code blocks if it makes sense though, if your going to be using this RestartRound() Method multiple times elsewhere in your code, then its a good idea to have it in its own method. Whereas if you were only using the functionality once then it might not be as important to do so.