// Method for handling global events in the Unity Editor. static void GlobalEventHandler() { // If a reference to the rig exists. if (Rig != null) { // Set Rig movements based on key combinations. Rig.MovingForward = MoveForward.KeyCombinationDown(); Rig.MovingBackward = MoveBackward.KeyCombinationDown(); Rig.MovingLeft = MoveLeft.KeyCombinationDown(); Rig.MovingRight = MoveRight.KeyCombinationDown(); Rig.RotatingLeft = RotateLeft.KeyCombinationDown(); Rig.RotatingRight = RotateRight.KeyCombinationDown(); Rig.LookingUp = LookUp.KeyCombinationDown(); Rig.LookingDown = LookDown.KeyCombinationDown(); } // If a reference to the lefthand controller exists. if (LeftHandController != null) { // Presses up on the primary 2D axis for the lefthand controller. if (LeftAxisUp.KeyCombinationClick()) { LeftHandController.Primary2DAxis.TouchAxisUp(); } // Presses down on the primary 2D axis for the lefthand controller. if (LeftAxisDown.KeyCombinationClick()) { LeftHandController.Primary2DAxis.TouchAxisDown(); } // Presses left on the primary 2D axis for the lefthand controller. if (LeftAxisLeft.KeyCombinationClick()) { LeftHandController.Primary2DAxis.TouchAxisLeft(); } // Presses right on the primary 2D axis for the lefthand controller. if (LeftAxisRight.KeyCombinationClick()) { LeftHandController.Primary2DAxis.TouchAxisRight(); } // Touches or untouhces the primary 2D axis for the lefthand controller. if (LeftAxisTouch.KeyCombinationClick()) { LeftHandController.Primary2DAxis.Touch = !LeftHandController.Primary2DAxis.Touch; } // Clicks or unclicks the primary 2D axis for the lefthand controller. if (LeftAxisClick.KeyCombinationClick()) { LeftHandController.Primary2DAxis.Click = !LeftHandController.Primary2DAxis.Click; } // Clicks or unclicks the trigger button for the lefthand controller. if (LeftTriggerButton.KeyCombinationClick()) { LeftHandController.Trigger.Button = !LeftHandController.Trigger.Button; } // Clicks or unclicks the grip button for the lefthand controller. if (LeftGripButton.KeyCombinationClick()) { LeftHandController.Grip.Button = !LeftHandController.Grip.Button; } // Clicks or unclicks the primary button for the lefthand controller. if (LeftPrimaryButton.KeyCombinationClick()) { LeftHandController.PrimaryButton.Button = !LeftHandController.PrimaryButton.Button; } } // If a reference to the righthand controller exists. if (RightHandController != null) { // Presses up on the primary 2D axis for the righthand controller. if (RightAxisUp.KeyCombinationClick()) { RightHandController.Primary2DAxis.TouchAxisUp(); } // Presses down on the primary 2D axis for the righthand controller. if (RightAxisDown.KeyCombinationClick()) { RightHandController.Primary2DAxis.TouchAxisDown(); } // Presses left on the primary 2D axis for the righthand controller. if (RightAxisLeft.KeyCombinationClick()) { RightHandController.Primary2DAxis.TouchAxisLeft(); } // Presses right on the primary 2D axis for the righthand controller. if (RightAxisRight.KeyCombinationClick()) { RightHandController.Primary2DAxis.TouchAxisRight(); } // Touches or untouhces the primary 2D axis for the righthand controller. if (RightAxisTouch.KeyCombinationClick()) { RightHandController.Primary2DAxis.Touch = !RightHandController.Primary2DAxis.Touch; } // Clicks or unclicks the primary 2D axis for the righthand controller. if (RightAxisClick.KeyCombinationClick()) { RightHandController.Primary2DAxis.Click = !RightHandController.Primary2DAxis.Click; } // Clicks or unclicks the trigger button for the righthand controller. if (RightTriggerButton.KeyCombinationClick()) { RightHandController.Trigger.Button = !RightHandController.Trigger.Button; } // Clicks or unclicks the grip button for the righthand controller. if (RightGripButton.KeyCombinationClick()) { RightHandController.Grip.Button = !RightHandController.Grip.Button; } // Clicks or unclicks the primary button for the righthand controller. if (RightPrimaryButton.KeyCombinationClick()) { RightHandController.PrimaryButton.Button = !RightHandController.PrimaryButton.Button; } } }