Пример #1
0
 protected override IEnumerable <IShortcut> CreateShortcuts()
 {
     return(base.CreateShortcuts().Concat(new IShortcut[] {
         new MultiKeyboardShortcut(new KeyStroke("Ctrl+C"), new KeyStroke("Ctrl+C"), () => { VRLog.Info("Mode Change to Standing Mode"); VR.Manager.SetMode(ModeType.StandingMode); }),
         new KeyboardShortcut(new KeyStroke("Ctrl+Space"), () => {
             if (monitor != null)
             {
                 if (monitor.activeSelf)
                 {
                     monitor.SetActive(false);
                     VRLog.Info("Monitor inactive");
                 }
                 else
                 {
                     MoveMonitor(VR.Camera.Head);
                     monitor.SetActive(true);
                     VRLog.Info($"Monitor active, show position is {monitor.transform.position}");
                 }
             }
             else
             {
                 VRLog.Info($"Monitor is Destroyed, Recreated Yet");
                 monitor = DesktopMonitor.Create(DesktopMonitor.CreateType.Stationary);
             }
         }),
         new MultiKeyboardShortcut(new KeyStroke("Ctrl+C"), new KeyStroke("Ctrl+R"), () => { SteamVR.instance.hmd.ResetSeatedZeroPose(); })
     }));
 }
Пример #2
0
        private void MonitorDisplayChange()
        {
            // モニタをメニューボタンを押下した側に移動するか、関連付け中にメニューボタンを押したら表示/非表示を切り替える.
            if (Monitor != null)
            {
                if (Left.MenuButtonDown)
                {
                    if (Monitor.transform.parent == Left.transform)
                    {
                        var activated = !Monitor.isActiveAndEnabled;
                        Monitor.SetActive(activated);
                        Left.SetModelActive(!activated);
                    }
                    else
                    {
                        Monitor.transform.SetParent(Left.transform, false);
                        Emulator.transform.SetParent(Right.transform, false);
                        Emulator.controller = Right;
                        Monitor.SetActive(true);
                        Left.SetModelActive(false);
                        Right.SetModelActive(true);
                    }
                }
                else if (Right.MenuButtonDown)
                {
                    if (Monitor.transform.parent == Right.transform)
                    {
                        var activated = !Monitor.isActiveAndEnabled;

                        Monitor.SetActive(activated);
                        Right.SetModelActive(!activated);
                    }
                    else
                    {
                        Monitor.transform.SetParent(Right.transform, false);
                        Emulator.transform.SetParent(Left.transform, false);
                        Emulator.controller = Left;
                        Monitor.SetActive(true);
                        Left.SetModelActive(true);
                        Right.SetModelActive(false);
                    }
                }
            }
            else
            {
                VRLog.Info("Monitor Destroyed Recreated Yet");
                Monitor = DesktopMonitor.Create(DesktopMonitor.CreateType.RoomScale);
            }
        }