PlayerPrefs clashing with TextField?

Hello all,

I’ve been trying to use PlayerPrefs (only since I weren’t able to get unity to create cookies, dunno why) and I have been able to save and get info from PlayerPrefs.
My problem starts when I try to change the text string I have imported from the PlayerPrefs at Awake()/Start().
For some reason the TextField showing the text string imported, won’t let me modify the field now. No key stroke works.

Any ideas?

Thanks in advance.

following is the code I used:

if(!PlayerPrefs.HasKey("Username") && createCookie){ //check if the user already exists and if he asked to be remembered
    PlayerPrefs.SetString("Username",Username);
    PlayerPrefs.SetString("Password",Password);
    PlayerPrefs.SetString("User",Name+" "+Surname); //saving the full name with which the user logged in
}else if(!createCookie){ //if he doesn't ask to be remembered, i run a "delete all" just to make sure. I have no other place where i use playerprefs so its ok.
    PlayerPrefs.DeleteAll();
}

now the part where i’m saving the data

if(Username=="" && PlayerPrefs.HasKey("Username")){
    Username=PlayerPrefs.GetString("Username");
    Password=PlayerPrefs.GetString("Password");
}

*note: i consider myself a fairly intelligent human being and quite the internet savvy, but i STILL don’t understand how the heck this code format thing works…

edit:
I’m adding the code for the GUI, as requested by Bunny83, where you can see that I actually DID write it as you suggested.

GUI.Label(Rect(20,30,80,20),"Username:");
Username = GUI.TextField(Rect(90,30,100,20),Username);
GUI.Label(Rect(20,60,80,20),"Password:");
Password = GUI.PasswordField(Rect(90,60,100,20),Password,"*"[0],16);
createCookie = GUI.Toggle(Rect(20,80,100,20),createCookie,"Remember Me");

Ehmm :D if you have problems with the TextField in Unity, you should post that code. I'm pretty sure you use the TextField like this:

GUILayout.TextField(Username);

This function returns the edited text, so you have to do it this way:

Username = GUILayout.TextField(Username);

edit

ps. works the same for GUI.TextField.

Stupid question, stupid solution:

Put the variable load part in Start(){} and gui in OnGUI(){} of course.

Happy Kwanza everybody!