Skip to content

Instantly share code, notes, and snippets.

@rtauziac
Created February 10, 2021 14:40
Show Gist options
  • Save rtauziac/476910340c7cbba31ee88b1443f202c6 to your computer and use it in GitHub Desktop.
Save rtauziac/476910340c7cbba31ee88b1443f202c6 to your computer and use it in GitHub Desktop.
Open Explorer window from Unity
// Unity behavior
// When the `O` key is pressed, it opens an explorer window at the persistent data path.
private void Update()
{
#if UNITY_STANDALONE_WIN
if (Input.GetKeyDown(KeyCode.O))
{
var explorerArgument = Application.persistentDataPath;
explorerArgument = ContactFormBehavior.csvDirectoryPath.Replace("/", "\\");
System.Diagnostics.Process p = new System.Diagnostics.Process();
Debug.Log(ContactFormBehavior.csvDirectoryPath);
p.StartInfo = new System.Diagnostics.ProcessStartInfo("explorer.exe", explorerArgument);
p.Start();
}
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment