Last active
August 29, 2015 14:16
-
-
Save baba-s/3931f2e9695978f1b100 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using System.Diagnostics; | |
| using UnityEditor; | |
| using UnityEngine; | |
| [InitializeOnLoad] | |
| public static class ExplorerShower | |
| { | |
| static ExplorerShower() | |
| { | |
| EditorApplication.projectWindowItemOnGUI += OnProjectWindowItemOnGUI; | |
| } | |
| private static void OnProjectWindowItemOnGUI( | |
| string guid, | |
| Rect selectionRect | |
| ) | |
| { | |
| var rect = selectionRect; | |
| rect.width = 20; | |
| rect.x = selectionRect.xMax - 20; | |
| if ( GUI.Button( rect, "!" ) ) | |
| { | |
| var assetPath = AssetDatabase.GUIDToAssetPath( guid ); | |
| assetPath = assetPath.Replace( "/", "\\" ); | |
| Process.Start( "explorer.exe", "/select," + assetPath ); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment