Example #1
0
        void Update()
        {
            var isInShip = _cockpitController.IsPlayerAtFlightConsole();

            if (isInShip && !_canInteractWithTools)
            {
                SetEnabled(true);
            }
            else if (!isInShip && _canInteractWithTools)
            {
                SetEnabled(false);
            }

            if (_referenceFrameTracker.isActiveAndEnabled && Common.IsUsingAnyTool())
            {
                _referenceFrameTracker.enabled = false;
            }
            else if (!_referenceFrameTracker.isActiveAndEnabled && !Common.IsUsingAnyTool())
            {
                _referenceFrameTracker.enabled = true;
            }

            if (_referenceFrameTracker.GetReferenceFrame() == null && _referenceFrameTracker.GetPossibleReferenceFrame() == null)
            {
                return;
            }
            if (OWInput.IsNewlyPressed(InputLibrary.interact))
            {
                _pressedInteract = true;
            }
            if (OWInput.IsNewlyHeld(InputLibrary.interact))
            {
                ControllerInput.SimulateInput(XboxAxis.dPadY, 1);
                _wasHoldingInteract = true;
            }
            if (OWInput.IsNewlyReleased(InputLibrary.interact))
            {
                if (_wasHoldingInteract)
                {
                    ControllerInput.SimulateInput(XboxAxis.dPadY, 0);
                    _wasHoldingInteract = false;
                }
                else if (_pressedInteract && !IsFocused(_probe) && !IsFocused(_signalscope) && !IsFocused(_landingCam))
                {
                    ControllerInput.SimulateInput(XboxButton.LeftStickClick);
                }
                _pressedInteract = false;
            }
        }
Example #2
0
 void OnDetectorExit()
 {
     ControllerInput.SimulateInput(XboxAxis.dPadX, 0);
 }
Example #3
0
 void OnDetectorEnter()
 {
     ControllerInput.SimulateInput(XboxAxis.dPadX, 1);
 }
Example #4
0
 void OnRelease()
 {
     ControllerInput.SimulateInput(button, 0);
     receiver.ResetInteraction();
 }
Example #5
0
 void OnPress()
 {
     ControllerInput.SimulateInput(button, 1);
 }
Example #6
0
 void FlashlightRelease()
 {
     ControllerInput.SimulateInput(XboxButton.RightStickClick, 0);
 }
Example #7
0
 void FlashlightPress()
 {
     ControllerInput.SimulateInput(XboxButton.RightStickClick, 1);
 }