Exemplo n.º 1
0
        static QuickFindWindowListener()
        {
            System.Reflection.FieldInfo        globalEventHandlerField = typeof(EditorApplication).GetField("globalEventHandler", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            EditorApplication.CallbackFunction globalEventHandler      = (EditorApplication.CallbackFunction)globalEventHandlerField.GetValue(null);

            globalEventHandler += OnGlobalEvent;
            globalEventHandlerField.SetValue(null, globalEventHandler);
            // SceneView.onSceneGUIDelegate += OnSceneGUI;

            settings = QuickFind.Settings.QuickFindSettings.GetOrCreateSettings();
        }
Exemplo n.º 2
0
        internal static void ShowWindow()
        {
            var window = ScriptableObject.CreateInstance(typeof(QuickFindWindow)) as QuickFindWindow;

            if (settings == null)
            {
                settings = QuickFind.Settings.QuickFindSettings.GetOrCreateSettings();
            }

            window.maxSize = new Vector2(600f, m_styles.searchFieldHeight + m_styles.iconSize * settings.Window.ExpandedRows);  // TODO fix (this is too small)
            window.minSize = new Vector2(600f, m_styles.searchFieldHeight);
            window.CenterOnApplicationWindow(window.maxSize);
            var winRect = window.position;

            winRect.height  = m_styles.searchFieldHeight;
            window.position = winRect;

            window.ShowPopup();
        }