Is it possible to set variables for classes?

I’m basically making a single Game Controller script for many levels.The references of each level is stored in different classes like level 1,level 2 etc.So I need to refer these classes in my controller script .How can set a public variable that denote these classes so i can put that variable in the code

`“variable” reference = GetComponent<“variable”>();

Use the name of the class as the type of the variable. After you have compiled your Game Controller class (which is, for example the LevelScript):

FirstLevelScript lvl1 = GetComponent<FirstLevelScript>();

This ‘lvl1’ variable will return the script named FirstLevelScript on the GameObject.