본문 바로가기
Unity3D

PlayerPrefs 저장위치

by CodeDiver 2014. 4. 7.

PlayerPrefsNamespace: UnityEngine

Description

Stores and accesses player preferences between game sessions.

Editor/Standalone

On Mac OS X PlayerPrefs are stored in ~LibraryPreferences folder, in a file named unity.[company name].[product name].plist, where company and product names are the names set up in Project Settings. The same .plist file is used for both Projects run in the Editor and standalone players.

On Windows, PlayerPrefs are stored in the registry under HKCU\Software\[company name]\[product name] key, where company and product names are the names set up in Project Settings.

On Linux, PlayerPrefs can be found in ~/.configunity3d[CompanyName]/[ProductName] again using the company and product names specified in the Project Settings.

WebPlayer

On Web players, PlayerPrefs are stored in binary files in the following locations:

Mac OS X: ~LibraryPreferencesUnityWebPlayerPrefs

Windows: %APPDATA%\Unity\WebPlayerPrefs

There is one preference file per Web player URL and the file size is limited to 1 megabyte. If this limit is exceeded, SetInt, SetFloat and SetString will not store the value and throw a PlayerPrefsException.
Static Functions
DeleteAllRemoves all keys and values from the preferences. Use with caution.
DeleteKeyRemoves key and its corresponding value from the preferences.
GetFloatReturns the value corresponding to key in the preference file if it exists.
GetIntReturns the value corresponding to key in the preference file if it exists.
GetStringReturns the value corresponding to key in the preference file if it exists.
HasKeyReturns true if key exists in the preferences.
SaveWrites all modified preferences to disk.
SetFloatSets the value of the preference identified by key.
SetIntSets the value of the preference identified by key.
SetStringSets the value of the preference identified by key.