void OnGUI() { if (gui_enabled) // don't create windows unless we're going to show them { GUI.skin = HighLogic.Skin; if (windowpos.x == 0) { windowpos = new Rect(Screen.width / 2 - 250, Screen.height / 2 - 30, 0, 0); } string name = "Advanced Input"; string ver = AdvancedInputVersionReport.GetVersion(); windowpos = GUILayout.Window(GetInstanceID(), windowpos, WindowGUI, name + " " + ver, GUILayout.Width(500)); if (windowpos.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { InputLockManager.SetControlLock("AI_test_window_lock"); } else { InputLockManager.RemoveControlLock("AI_test_window_lock"); } } else { InputLockManager.RemoveControlLock("AI_test_window_lock"); } }
void VersionInfo() { string ver = AdvancedInputVersionReport.GetVersion(); GUILayout.Label(ver); }