Pause - Quality Settings

JavaScript newbie here…just wanting to know how would I update my script to be more valid ?

The script pauses my game correctly and the user can adjust the settings accordingly, but at the moment I’m receiving this message:

Assets/Scripts/level01/Pause.js(188,29): BCW0012: WARNING: ‘UnityEngine.QualitySettings.currentLevel’ is obsolete. Use GetQualityLevel and SetQualityLevel

Script:

function Qualities() {
//switch (GetQualityLevel.currentLevel) {
//switch (SetQualityLevel.currentLevel) {
//switch (GetQualityLevel.SetQualityLevel) {
//switch (SetQualityLevel.GetQualityLevel) {
//switch (QualitySettings.GetQualityLevel) {
//switch (QualitySettings.SetQualityLevel) {

    switch (QualitySettings.currentLevel) {
        case QualityLevel.Fastest:
        GUI.contentColor = Color.black;
        GUILayout.Label("Fastest");
        break;
        case QualityLevel.Fast:
        GUI.contentColor = Color.black;
        GUILayout.Label("Fast");
        break;
        case QualityLevel.Simple:
        GUI.contentColor = Color.black;
        GUILayout.Label("Simple");
        break;
        case QualityLevel.Good:
        GUI.contentColor = Color.black;
        GUILayout.Label("Good");
        break;
        case QualityLevel.Beautiful:
        GUI.contentColor = Color.black;
        GUILayout.Label("Beautiful");
        break;
        case QualityLevel.Fantastic:
        GUI.contentColor = Color.black;
        GUILayout.Label("Fantastic");
        break;
    }
}

Thanks.

If I replace the entire function with the one below, it somehow works fine…

I’m not 100% sure why or how it knows to call “Fastest”, “Fast”, “Simple”, “Good” etc. but it does the trick.

function Qualities() {
    GUILayout.Label(QualitySettings.names[QualitySettings.GetQualityLevel()]);
}

Update:

For a further breakdown of the pause script being used, visit here or for the latest version, visit here.