KLF.KLFManager.CheckEditorLock C# (CSharp) Method

CheckEditorLock() private method

private CheckEditorLock ( ) : void
return void
        private void CheckEditorLock()
        {
            Vector2 mousePos = Input.mousePosition;
            mousePos.y = Screen.height - mousePos.y;

            bool should_lock = HighLogic.LoadedSceneIsEditor && shouldDrawGUI && (
                    KLFInfoDisplay.infoWindowPos.Contains(mousePos)
                    || (KLFScreenshotDisplay.windowEnabled && KLFScreenshotDisplay.windowPos.Contains(mousePos))
                    || (KLFGlobalSettings.instance.chatWindowEnabled && KLFChatDisplay.windowPos.Contains(mousePos))
                    );

            if (should_lock && !isEditorLocked && !EditorLogic.editorLocked)
            {
                EditorLogic.fetch.Lock(true, true, true);
                isEditorLocked = true;
            }
            else if (!should_lock && isEditorLocked && EditorLogic.editorLocked)
            {
                EditorLogic.fetch.Unlock();
                isEditorLocked = false;
            }
        }