using System.IO;
using UnityEngine;
using UnityEditor;

public static class PlayerPrefsResetter {

    [MenuItem("Tools/ResetTool/Reset PlayerPrefs")]
    public static void ResetPlayerPrefs(){
        PlayerPrefs.DeleteAll();
        PlayerPrefs.Save();
        Debug.Log("Reset PlayerPrefs");
    }

    [MenuItem("Tools/ResetTool/Reset Data")]
    public static void ResetData(){
        UsayaStorageManager.Remove(UsayaStorageFilename.Main_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Settings_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Wallet_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Purchaser_Data, Const.GameDataTag);
        Debug.Log("Reset Data");
    }

    [MenuItem("Tools/ResetTool/Reset All Data")]
    public static void ResetAllData(){
        UsayaStorageManager.Remove(UsayaStorageFilename.Main_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Settings_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Wallet_Data, Const.GameDataTag);
        UsayaStorageManager.Remove(UsayaStorageFilename.Purchaser_Data, Const.GameDataTag);
        PlayerPrefs.DeleteAll();
        PlayerPrefs.Save();
        Debug.Log("Reset All Data");
    }
    [MenuItem("Tools/ResetTool/Delete All Data")]
    public static void DeleteAllData(){
        if(!Directory.Exists(Application.persistentDataPath)){
            Debug.Log("Aready deleted.");
            return;
        }
        Directory.Delete(Application.persistentDataPath, true);
        Debug.Log("Delete All Data");
    }
}