Skip to content

Instantly share code, notes, and snippets.

@baba-s
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save baba-s/3931f2e9695978f1b100 to your computer and use it in GitHub Desktop.

Select an option

Save baba-s/3931f2e9695978f1b100 to your computer and use it in GitHub Desktop.
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