Issue with playerPrefs

I have a scene that shows a users score for that round and the highest score gotten in the level. The high score works fine, and updates accordingly each time I beat the last highscore. The problem is, my current score always says 0 instead of what I actually got in that round. Code:


 if (currentLevel == "colorCoded")
    { = true;
        colorCodedScore.text = "Score: " + PlayerPrefs.GetInt("colorCodedScore", GUICounters.score);

        colorCodedHighScore.text = "High Score: " + PlayerPrefs.GetInt("colorCodedHighScore", GUICounters.highestScore);
    else = false;

if (PlayerPrefs.GetInt(“colorCodedHighScore”, GUICounters.highestScore) < GUICounters.score)
GUICounters.highestScore = GUICounters.score;
PlayerPrefs.SetInt(“colorCodedHighScore”, GUICounters.highestScore);
PlayerPrefs.SetInt(“colorCodedScore”, GUICounters.score);

GUICounters.score = 0;
GUICounters.timer = 0;

Can anyone see anything wrong with the above?

Given your logic here, you only set the ‘colorCodedScore’ if the you don’t set a new high score. If I understand correctly, you just want to remove the ‘else’ on line 7, so that the current score gets set each frame.