Script needed For Level Selection

I have a Main Menu scene in which all the buttons are there and every button is attached with different level now i want a script in which first level button is always interactive but the other levels are opened 1 by 1 when their previous scene is completed a game manager script is added to all scenes which has a win condition

if(connect == total)
        Debug.Log("You Won");