Exemple #1
0
 public void AllMPIbuttonsON()
 {
     ButtonsGroup.Invoke((MethodInvoker) delegate { ButtonsGroup.Enabled = true; });
     if (VKGroupIsEnable)
     {
         VKGroup.Invoke((MethodInvoker) delegate { VKGroup.Enabled = true; });
     }
 }
Exemple #2
0
 public void Rebuild(List <string> keys)
 {
     _names.Clear();
     _buttons.Clear();
     CreateDictionaryNames();
     Sprite         = new UiTestSprite(_config["sprite_config"]);
     ObjectPosition = new UiTestObjectPosition(_config["object_config"]);
     foreach (var key in keys)
     {
         var battle = new ButtonsGroup(_config["ui_config"][key], _names);
         _buttons[key] = battle;
     }
 }
Exemple #3
0
        private void inputListener(InputDevice device, XRNode xRNode, ButtonsGroup buttonStates)
        {
            if (!device.isValid)
            {
                GetDevice();
            }

            // XR Input Mapping - https://docs.unity3d.com/Manual/xr_input.html

            // CommonUsages.primary2DAxis
            device.TryGetFeatureValue(CommonUsages.primary2DAxis, out Vector2 primary2DAxisValue);
            if (buttonStates.primary2DAxis.value != primary2DAxisValue)
            {
                buttonStates.primary2DAxis.value = primary2DAxisValue;
                Print("primary2DAxis", buttonStates.primary2DAxis.value.ToString(), (buttonStates.primary2DAxis.value.x > 0.01f || buttonStates.primary2DAxis.value.y > 0.01f), xRNode);
            }

            // CommonUsages.primary2DAxisClick
            bool prevPrimary2DAxisClickValue = buttonStates.primary2DAxis.isPressed;

            device.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out buttonStates.primary2DAxis.isPressed);
            if (buttonStates.primary2DAxis.isPressed != prevPrimary2DAxisClickValue)
            {
                Print("primary2DAxisClick", buttonStates.primary2DAxis.isPressed.ToString(), buttonStates.primary2DAxis.isPressed, xRNode);
            }

            // CommonUsages.primary2DAxisTouch
            bool prevPrimary2DAxisTouchValue = buttonStates.primary2DAxis.isTouched;

            device.TryGetFeatureValue(CommonUsages.primary2DAxisTouch, out buttonStates.primary2DAxis.isTouched);
            if (buttonStates.primary2DAxis.isPressed != prevPrimary2DAxisTouchValue)
            {
                Print("primary2DAxisTouch", buttonStates.primary2DAxis.isTouched.ToString(), buttonStates.primary2DAxis.isTouched, xRNode);
            }

            // CommonUsages.trigger
            float prevTriggerValue = buttonStates.trigger.value;

            device.TryGetFeatureValue(CommonUsages.trigger, out buttonStates.trigger.value);
            if (buttonStates.trigger.value != prevTriggerValue)
            {
                Print("Trigger", buttonStates.trigger.value.ToString(), (buttonStates.trigger.value != 0f), xRNode);
            }

            // CommonUsages.triggerButton
            bool prevTriggerButtonValue = buttonStates.trigger.isPressed;

            device.TryGetFeatureValue(CommonUsages.triggerButton, out buttonStates.trigger.isPressed);
            if (buttonStates.trigger.isPressed != prevTriggerButtonValue)
            {
                Print("TriggerButton", buttonStates.trigger.isPressed.ToString(), buttonStates.trigger.isPressed, xRNode);
            }

            // CommonUsages.grip
            float prevGripValue = buttonStates.grip.value;

            device.TryGetFeatureValue(CommonUsages.grip, out buttonStates.grip.value);
            if (buttonStates.grip.value != prevGripValue)
            {
                Print("Grip", buttonStates.grip.value.ToString(), buttonStates.grip.value != 0f, xRNode);
            }

            // CommonUsages.gripButton
            bool prevGripButtonValue = buttonStates.grip.isPressed;

            device.TryGetFeatureValue(CommonUsages.gripButton, out buttonStates.grip.isPressed);
            if (buttonStates.grip.isPressed != prevGripButtonValue)
            {
                Print("GripButton", buttonStates.grip.isPressed.ToString(), buttonStates.grip.isPressed, xRNode);
            }

            // CommonUsages.primaryButton
            bool prevPrimaryButtonValue = buttonStates.primaryButton.isPressed;

            device.TryGetFeatureValue(CommonUsages.primaryButton, out buttonStates.primaryButton.isPressed);
            if (buttonStates.primaryButton.isPressed != prevPrimaryButtonValue)
            {
                Print("PrimaryButton", buttonStates.primaryButton.isPressed.ToString(), buttonStates.primaryButton.isPressed, xRNode);
            }

            // CommonUsages.primaryTouch
            bool prevPrimaryTouchValue = buttonStates.primaryTouch.isPressed;

            device.TryGetFeatureValue(CommonUsages.primaryTouch, out buttonStates.primaryTouch.isPressed);
            if (buttonStates.primaryTouch.isPressed != prevPrimaryTouchValue)
            {
                Print("PrimaryTouch", buttonStates.primaryTouch.isPressed.ToString(), buttonStates.primaryTouch.isPressed, xRNode);
            }

            // CommonUsages.secondarzButton
            bool prevSecondaryButtonValue = buttonStates.secondaryButton.isPressed;

            device.TryGetFeatureValue(CommonUsages.secondaryButton, out buttonStates.secondaryButton.isPressed);
            if (buttonStates.secondaryButton.isPressed != prevSecondaryButtonValue)
            {
                Print("SecondaryButton", buttonStates.secondaryButton.isPressed.ToString(), buttonStates.secondaryButton.isPressed, xRNode);
            }

            // CommonUsages.secondaryTouch
            bool prevSecondaryTouchValue = buttonStates.secondaryTouch.isPressed;

            device.TryGetFeatureValue(CommonUsages.secondaryTouch, out buttonStates.secondaryTouch.isPressed);
            if (buttonStates.secondaryTouch.isPressed != prevSecondaryTouchValue)
            {
                Print("SecondaryTouch", buttonStates.secondaryTouch.isPressed.ToString(), buttonStates.secondaryTouch.isPressed, xRNode);
            }

            // CommonUsages.menuButton
            bool prevMenuButtonhValue = buttonStates.menuButton.isPressed;

            device.TryGetFeatureValue(CommonUsages.menuButton, out buttonStates.menuButton.isPressed);
            if (buttonStates.menuButton.isPressed != prevMenuButtonhValue)
            {
                Print("MenuButton", buttonStates.menuButton.isPressed.ToString(), buttonStates.menuButton.isPressed, xRNode);
            }

            // CommonUsages.thumbrest
            bool prevUserPresenceValue = buttonStates.userPresence.isPresented;

            device.TryGetFeatureValue(CommonUsages.userPresence, out buttonStates.userPresence.isPresented);
            if (buttonStates.userPresence.isPresented != prevUserPresenceValue)
            {
                Print("UserPresence", buttonStates.userPresence.isPresented.ToString(), buttonStates.userPresence.isPresented, xRNode);
            }
        }
Exemple #4
0
 public void AllMPIbuttonsOFF()
 {
     ButtonsGroup.Invoke((MethodInvoker) delegate { ButtonsGroup.Enabled = false; });
     VKGroup.Invoke((MethodInvoker) delegate { VKGroup.Enabled = false; });
 }