making a level not play able until a level is beaten

I am using a script to load my levels but i can’t figure out how to make them not active until for instance level 1 is beaten. Only then you could play level2 and so on.

var levelToLoad : String; 
var soundhover : AudioClip; 
var beep : AudioClip; 
var QuitButton : boolean = false; 

function OnMouseEnter(){ 

function OnMouseUp(){ 
    yield new WaitForSeconds(0.35); 
    } else{ 
@script RequireComponent(AudioSource)

Check about this in unity scripting refrence :

print (PlayerPrefs.GetInt("LastLevelopen"));

Check more about PlayerPrefs there u can simply get this number and then u know which level to load then make it one more when the player has bitten a new level! (by reading it frist and then putting ++ of it with SetInt for sure :D)this thing will be uniqe for each computer even if ur game is portable :open_mouth: .