コード例 #1
0
 public void Update()
 {
     if (observer != null)
     {
         observer.Update();
     }
 }
コード例 #2
0
            public void Update()
            {
                if (Input.GetKeyDown(KeyCode.LeftAlt))
                {
                    keyAltPressed = true;
                }
                if (Input.GetKeyUp(KeyCode.LeftAlt))
                {
                    keyAltPressed = false;
                }
                if (Input.GetKeyDown(KeyCode.LeftControl))
                {
                    keyCtrlPressed = true;
                }
                if (Input.GetKeyUp(KeyCode.LeftControl))
                {
                    keyCtrlPressed = false;
                }
                if (Config.IsHotkeyEnabled() && keyAltPressed && Input.GetKeyDown(KeyCode.F))
                {
                    Log.Info("hotkey ALT-F detected");

                    switch (HighLogic.LoadedScene)
                    {
                    case GameScenes.EDITOR:
                    case GameScenes.FLIGHT:
                    case GameScenes.SPACECENTER:
                    case GameScenes.TRACKSTATION:
                        if (!keyCtrlPressed)
                        {
                            Log.Info("hotkey hall of fame browser");
                            createBrowserOnce();
                            browser.SetVisible(!browser.IsVisible());
                        }
                        else
                        {
                            Log.Info("hotkey reset window positions");
                            PositionableWindow.ResetAllWindowPositions();
                        }
                        break;

                    default:
                        Log.Info("cant open/close hall of fame in game scene " + HighLogic.LoadedScene);
                        break;
                    }
                }

                if (observer != null)
                {
                    observer.Update();
                }
            }