Question regarding transporting my character to new level using switch case

Hello. I have a question since I am new to unity. I created a simple scene level where I placed 4 cubes on the level and created a FPS character to move around. I used a pick-up script to allow my character to pick up the 4 cubes. My question is that I need help created a switch case script so that after collecting the 4 cubes I want text to appear on the screen saying something like “Congratulations! Proceed to next level” then after that I need a command to happen like character touching an object or pressing a button to be transported to a new scene level AFTER collecting the 4 cubes. Help would be appreciated. Thanks!

What you need to do is keep a count of how many cubes have been picked up, and once four cubes have been picked up, display the window for going to the next level.

Something like this:

var levNumber : int;
private var cubeCount : int;
private var displayText : boolean = false;

function Update(){
     // Load Next Level when clicking and having enough cubes
     if(Input.GetMouseButtonDown(0) && cubeCount == 4){
          Application.LoadLevel(levNumber);
     }
}
function OnGUI(){
     if(displayText == true){
         // Show Text or Window
     }
}
function AddCubeCount(){
     cubeCount++;
     if(cubeCount == 4){
          displayText = true;
     }
]

You an then use SendMessage to tell the script that you picked up a cube.
I hope this helps.

When I create this script, on which game object to I attach it to? And Lets say my second level is the called the file Level2.unity, where in the code do I put this? And my cubes is a prefab, lets say the name of the prefab is CubeObject, where in the code do I put this? Sorry, new to scripting and I do appreciate the help.