Levels Loading Randomly

I made a Breakout clone game after following a tutorial on YouTube. The game works with the way I have levels 1 and 2 set up, but when I add more levels they load randomly. I have them loaded in the Build Settings and I have them being pulled from the code using Application.LoadLevel but they keep loading randomly.

Here is my code from the BrickScript and a screenshot of the Build Settings. Not really sure what’s going on to make the levels load randomly since it’s not set up that way - at least I don’t think they are. (And yes, I did try to contact the tutorial creator but I didn’t receive a response.)

Screenshot:
Imgur

Code:
using UnityEngine;
using System.Collections;

public class BrickScript : MonoBehaviour {
	
	static int numBricks = 0;
	public int pointValue = 1; 
	public int hitPoints = 1;

	// Use this for initialization
	void Start () {
		numBricks++;
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void OnCollisionEnter (Collision col) {
		hitPoints--;
		
		if(hitPoints <= 0){
			Die();
		}
	}
	
	void Die(){
		Destroy(gameObject);
		PaddleScript paddleScript = GameObject.Find("Paddle").GetComponent<PaddleScript>();
		paddleScript.AddPoint(pointValue);
		numBricks--;
		Debug.Log (numBricks);
		
		if(numBricks <= 0){
			//Load a new level
			Application.LoadLevel("level2");
			Application.LoadLevel("level3");
			Application.LoadLevel("level4");
			Application.LoadLevel("level5");
			Application.LoadLevel("youWin");
			
		}
	}
}

I think I know what is wrong.

What you want to do is load the next level. However, you are adding all the next level code to the same place

if(numBricks <= 0){
         //Load a new level
         Application.LoadLevel("level2");
         Application.LoadLevel("level3");
         Application.LoadLevel("level4");
         Application.LoadLevel("level5");
         Application.LoadLevel("youWin");
 
       }

This code here loads every level at once … so the level that appears could be any one of them. To fix this add a variable that checks to see what level this is and load the consecutive level. If you have any questions on how to do this ask and I will give a example.

EDIT

How to fix the code:

Okay. The essayist option would be to create a public integer that you can edit in the unity editor.

You would set it to the number of the level in the editor and then come back to it in the code

public int level;

//Now you load the level

 if(numBricks <= 0){
                 if(level == 1) {
                 Application.LoadLevel("level2");
              } 
    else if(level == 2) {
                 Application.LoadLevel("level3");
    }
    else if(level == 3) {
                 Application.LoadLevel("level4");
    }
    else if(level == 4) {
                 Application.LoadLevel("level5");
    }
    else {
                 Application.LoadLevel("youWin");
}
         
               }