/// <summary> /// Pop disabled input state. When the last disabled state is /// popped off the stack input will be re-enabled. /// </summary> public void PopInputDisable() { --disabledRefCount; Debug.Assert(disabledRefCount >= 0, "Tried to pop more input disable than the amount pushed."); if (disabledRefCount == 0) { InputEnabled.RaiseEvent(); } }
/// <summary> /// Clear the input disable stack, which will immediately re-enable input. /// </summary> public void ClearInputDisableStack() { bool wasInputDisabled = disabledRefCount > 0; disabledRefCount = 0; if (wasInputDisabled) { InputEnabled.RaiseEvent(); } }