public void SceneManager_activeSceneChanged(Scene from, Scene to)
        {
            var vrPointers = Resources.FindObjectsOfTypeAll <VRPointer>();

            if (vrPointers.Count() == 0)
            {
                Plugin.Log("Failed to get VRPointer!");
                return;
            }

            var _vrPointer = to.name != "GameCore" ? vrPointers.First() : vrPointers.Last();

            if (_movePointer)
            {
                Destroy(_movePointer);
            }
            _movePointer = _vrPointer.gameObject.AddComponent <ChatMover>();
            _movePointer.Init(_chatMoverCube);

            if (_lockPointer)
            {
                Destroy(_lockPointer);
            }
            _lockPointer = _vrPointer.gameObject.AddComponent <LockToggle>();
            _lockPointer.Init(lockButtonImage, _lockButtonSphere);
            Plugin.Log($"{from.name} -> {to.name}");
        }
示例#2
0
 private void InstanceOnExtendedStatusUpdate(object sender, ExtendedStatusUpdateParser e)
 {
     Dispatcher.Invoke(() =>
     {
         LockToggle.SetChecked(e.TouchpadLock);
         LeftOption.TextDetail  = OptionToString(e.TouchpadOptionL, Constants.Devices.L);
         RightOption.TextDetail = OptionToString(e.TouchpadOptionR, Constants.Devices.R);
     });
 }
        private void InstanceOnExtendedStatusUpdate(object sender, ExtendedStatusUpdateParser e)
        {
            Dispatcher.Invoke(() =>
            {
                LockToggle.SetChecked(e.TouchpadLock);

                _lastLeftOption  = e.TouchpadOptionL;
                _lastRightOption = e.TouchpadOptionR;

                LeftOption.TextDetail  = OptionToString(e.TouchpadOptionL, Devices.L);
                RightOption.TextDetail = OptionToString(e.TouchpadOptionR, Devices.R);
                DoubleTapVolume.Switch.SetChecked(e.OutsideDoubleTap);
            });
        }
        public void SceneManager_activeSceneChanged(Scene from, Scene to)
        {
            var _vrPointer = to.name == "GameCore" ? Resources.FindObjectsOfTypeAll <VRPointer>().Last() : Resources.FindObjectsOfTypeAll <VRPointer>().First();

            if (_vrPointer == null)
            {
                return;
            }

            if (_movePointer)
            {
                Destroy(_movePointer);
            }
            _movePointer = _vrPointer.gameObject.AddComponent <ChatMover>();
            _movePointer.Init(_chatMoverCube);

            if (_lockPointer)
            {
                Destroy(_lockPointer);
            }
            _lockPointer = _vrPointer.gameObject.AddComponent <LockToggle>();
            _lockPointer.Init(lockButtonImage, _lockButtonSphere);
            Plugin.Log($"ActiveSceneChanged! ({from.name} -> {to.name})");
        }
 private void LockTouchpadBorder_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     LockToggle.Toggle();
     BluetoothService.Instance.SendAsync(SPPMessageBuilder.Touch.Lock(LockToggle.IsChecked));
 }