Created
February 10, 2021 14:40
-
-
Save rtauziac/476910340c7cbba31ee88b1443f202c6 to your computer and use it in GitHub Desktop.
Open Explorer window from Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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