/// <summary> /// Removes the given state and removes all instances of it from the focus stack. /// </summary> /// <param name="state"></param> public void EndState(State state) { states.RemoveBuffer.Add(state); State cur = GetFocusedState(); focusState.RemoveAll(i => i == state); if (GetFocusedState() != cur && GetFocusedState() != null) { state.OnBlur(); GetFocusedState().OnFocus(); } toSort = true; }
/// <summary> /// Removes the given state from the focus stack. /// </summary> public void DropFocus(State state) { State cur = GetFocusedState(); focusState.Remove(state); if (GetFocusedState() != cur && GetFocusedState() != null) { state.OnBlur(); if (focusState.Count > 0) { GetFocusedState().OnFocus(); } } }
/// <summary> /// Removes the given state from the focus stack. /// </summary> public void DropFocus(State state) { State cur = GetFocusedState(); focusState.Remove(state); if (GetFocusedState() != cur && GetFocusedState() != null) { state.OnBlur(); if (focusState.Count > 0) GetFocusedState().OnFocus(); } }