Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

unity remove playerprefs

//C# source code
PlayerPrefs.DeleteAll();

//Unity3d editor
Edit > Clear All PlayerPrefs
Comment

delete playerprefs with new application install unity

public class VersionCheck : MonoBehaviour
{
    private void Awake()
    {
        var version = PlayerPrefs.GetString("Version", string.Empty);

        if (string.IsNullOrWhiteSpace(version))
        {
            // Probably not more to do since there is no stored data apparently
            // Just to be sure you could still do
            PlayerPrefs.DeleteAll();

            // => THIS IS THE FIRST RUN
            PlayerPrefs.SetString("Version", Application.version);
        }
        else 
        {
            if(version != Application.version)
            {
                // => THIS IS A VERSION MISMATCH -> UPDATED
                PlayerPrefs.DeleteAll();

                PlayerPrefs.SetString("Version", Application.version);
            }
            // else
            //{
            //     // Otherwise it could either mean you re-installed the same version 
            //     // or just re-started the app -> There should be no difference between these two in behavior of your app
            //}
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Shell :: linux check if screen is running 
Shell :: move all files in subdirectories to current directory linux 
Shell :: scp local to ssh aws 
Shell :: shell play mp3 
Shell :: how to rename a file in linux 
Shell :: ping redis server 
Shell :: install python 3.6 in colab 
Shell :: bash add user to group 
Shell :: how to fix libffi missing in macos 
Shell :: remove umbrella roaming client 
Shell :: cmd for pushing to github for the first time 
Shell :: change shell script to executable 
Shell :: unzip 7z cli 
Shell :: almalinux helm 
Shell :: bash if statement 
Shell :: copy all in a folder here command terminal 
Shell :: react native navigation 
Shell :: update vs code ubuntu 
Shell :: how to cat a file that has spaces 
Shell :: ubuntu add multiverse 
Shell :: create a new git repository on the command line 
Shell :: linux permissions 
Shell :: git choose branch to push 
Shell :: how to unzip ubuntu 2004 
Shell :: linux edit file 
Shell :: kubectl connect to node bash 
Shell :: gatsby plugin image 
Shell :: how to git clone into a directory 
Shell :: convert windows file to unix 
Shell :: uninstall composer 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =