untiy delet ke 1

untiy delet ke

PlayerPrefs.DeleteKey(KeyName);

Here is what the above code is Doing:
1. We’re creating a variable called KeyName and setting it to the string “HighScore”.
2. We’re creating a variable called HighScore and setting it to the value of the PlayerPrefs key called “HighScore”.
3. We’re creating a variable called NewHighScore and setting it to the value of the Score variable.
4. We’re checking to see if the value of the NewHighScore variable is greater than the value of the HighScore variable.
5. If the value of the NewHighScore variable is greater than the value of the HighScore variable, we’re setting the value of the HighScore variable to the value of the NewHighScore variable.
6. We’re saving the value of the HighScore variable to the PlayerPrefs key called “HighScore”.
7. We’re deleting the PlayerPrefs key called “HighScore”.

Similar Posts