유니티 PlayerPrefs 초기화하는 방법

using UnityEngine;
using UnityEditor;

public class ResetPlayerPrefs : MonoBehaviour
{
    [MenuItem("Window/PlayerPrefs 초기화")]
    private static void ResetPrefs()
    {
        PlayerPrefs.DeleteAll();
        Debug.Log("PlayerPrefs has been reset.");
    }
}

 

유니티 에디터 상단에서 버튼을 통해 PlayerPrefs 데이터를 초기화하는 코드입니다.

상단에서 쉽게 초기화할 수 있다

 

코드는 에디터 폴더에 만드셔야 합니다.

코드를 만들고 나면 위 사진처럼 윈도우 탭에서 PlayerPrefs 데이터를 초기화할 수 있게 됩니다.