Thursday, 28 July 2016

How to delete persistent Data Path file




1.  Attack ClearSaveButton function to your delete Button.


Name Spaces maybe requires :-

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Runtime.Serialization.Formatters.Binary;
using System;
using System.IO;

public void ClearSaveButton()
{
ClearDataCanvas.enabled = false;
if (File.Exists (Application.persistentDataPath + "/playerInfo.dat"))
{
 
File.Delete(Application.persistentDataPath + "/playerInfo.dat");

Application.Quit ();
}
}

No comments:

Post a Comment