Ejemplo n.º 1
0
        private void OnDisable()
        {
            if (transparentBackground != null)
            {
                DestroyImmediate(transparentBackground);
                transparentBackground = null;
            }

            if (isValid && activeNode != null)
            {
                activeNode.option.OnFocusLeave(activeNode);
            }

            instance = null;
            EditorApplicationUtility.UnlockReloadAssemblies();
        }
Ejemplo n.º 2
0
        public bool isValid => tree != null;         // Will return false after reloading the window from serialization

        public static void Show(Rect activatorPosition, IFuzzyOptionTree optionTree, Action <IFuzzyOption> callback)
        {
            Ensure.That(nameof(optionTree)).IsNotNull(optionTree);

            // Makes sure control exits DelayedTextFields before opening the window
            GUIUtility.keyboardControl = 0;

            if (instance == null)
            {
                instance = CreateInstance <FuzzyWindow>();
            }
            else
            {
                throw new InvalidOperationException("Cannot open two instances of the fuzzy window at once.");
            }

            instance.Initialize(activatorPosition, optionTree, callback);
        }
Ejemplo n.º 3
0
 private void OnEnable()
 {
     instance = this;
     query    = string.Empty;
     EditorApplicationUtility.LockReloadAssemblies();
 }