private void OnDisable() { if (transparentBackground != null) { DestroyImmediate(transparentBackground); transparentBackground = null; } if (isValid && activeNode != null) { activeNode.option.OnFocusLeave(activeNode); } instance = null; EditorApplicationUtility.UnlockReloadAssemblies(); }
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); }
private void OnEnable() { instance = this; query = string.Empty; EditorApplicationUtility.LockReloadAssemblies(); }