Skip to content

Instantly share code, notes, and snippets.

@attilam
Created December 6, 2012 17:20
Show Gist options
  • Save attilam/4226250 to your computer and use it in GitHub Desktop.
Save attilam/4226250 to your computer and use it in GitHub Desktop.
Reveal Persistent Data Directory for current project in Unity
using UnityEngine;
using UnityEditor;
using System.Diagnostics;
public class RevealPersistentDataDirectory : MonoBehaviour {
[MenuItem("Assets/Reveal Persistent Data Directory")]
static void DoMenu() {
Process process = new Process();
process.StartInfo.FileName = ( (Application.platform == RuntimePlatform.WindowsEditor) ? "explorer.exe" : "open" );
process.StartInfo.Arguments = "file://"+Application.persistentDataPath;
process.Start();
}
}
@Grave18
Copy link

Grave18 commented Feb 27, 2024

using System.IO;
using UnityEditor;
using UnityEngine;

public static class RevealPersistentDataDirectory
{
    [MenuItem("Tools/Reveal Persistent Data Directory")]
    private static void DoMenu()
    {
        // Hack to RevealInFinder() open the specified folder not parent folder
        string path = Path.Combine(Application.persistentDataPath, "hack");
        EditorUtility.RevealInFinder(path);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment