Created
February 7, 2013 17:14
-
-
Save anchan828/4732498 to your computer and use it in GitHub Desktop.
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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Reflection; | |
public class HogeSearchableEditorWindow : SearchableEditorWindow | |
{ | |
static SearchableEditorWindow window = null; | |
[MenuItem("Window/HogeSearchableEditorWindow #%p")] | |
static void Open () | |
{ | |
GetWindow<HogeSearchableEditorWindow> ().Close (); | |
window = SearchableEditorWindow.CreateInstance<HogeSearchableEditorWindow> (); | |
} | |
void OnGUI () | |
{ | |
if (Event.current.keyCode == KeyCode.Escape) { | |
GetWindow<HogeSearchableEditorWindow> ().Close (); | |
} | |
typeof(SearchableEditorWindow).GetMethod ("SearchFieldGUI", (BindingFlags.Instance | BindingFlags.NonPublic)).Invoke (window, new object[0]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment