Souliloquy

Open a folder in explorer or finder from Unity

Feb 21st, 2022
1,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1.  
  2.     public static void OpenFolder(string path)
  3.     {
  4.         if (Application.platform == RuntimePlatform.WindowsEditor)
  5.         {
  6.             path = path.Replace(@"/", @"\");
  7.             System.Diagnostics.Process.Start("explorer.exe", "/select," + path);
  8.         }
  9.         else
  10.             EditorUtility.RevealInFinder(path);
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment