void Update()
    {
        //interactable = DetectInteractableWithinReach();
        interactable = DetectNearestInteractable();

        if (interactable == null)
        {
            return;
        }
        else
        {
            interactable.ShowInteractFeedback();
        }

        bool interactingThisFrame = RInput.GetButton("Interact");


        if (_isInterracting && interactingThisFrame)
        {
            interactable.InteractHold(this);
        }

        if (!_isInterracting && interactingThisFrame)
        {
            _isInterracting = true;
            interactable.InteractStart(this);
        }
        else if (_isInterracting && !interactingThisFrame)
        {
            _isInterracting = false;
            interactable.InteractStop(this);
        }
        return;
    }
Пример #2
0
    public void ResetKeybinds()
    {
        RInput.ResetKeybinds();

        // Refresh window
        gameObject.SetActive(false);
        gameObject.SetActive(true);
    }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     foreach (Rewired.Player RInput in RInputs)
     {
         if (RInput.GetAnyButtonDown())
         {
             _ptm.SwitchScene(_ptm.MenuScene);
             enabled = false;
         }
     }
 }
Пример #4
0
 private static void SetupInputActionMap(InputActionMap map)
 {
     foreach (InputAction item in map)
     {
         if (item.type == InputActionType.Button)
         {
             item.started  += ctx => RInput.AddStartedAction(ctx.action);
             item.canceled += ctx => RInput.AddCanceledAction(ctx.action);
         }
     }
 }
Пример #5
0
 private void Update()
 {
     foreach (Rewired.Player RInput in RInputs)
     {
         if (RInput.GetButtonDown("Interact"))
         {
             AkSoundEngine.StopAll();
             PlayTestMaster ptm = GameObject.Find("PlayTestMaster").GetComponent <PlayTestMaster>();
             ptm.SwitchScene(ptm.MenuScene);
             //enabled = false;
         }
     }
 }
Пример #6
0
    public void Confirm()
    {
        if (binding.isPartOfComposite)
        {
            input_action.ApplyBindingOverride(input_action.bindings.IndexOf((x) => x.name == binding.name), new_binding);
        }
        else
        {
            input_action.ApplyBindingOverride(new_binding);
        }

        RInput.SaveOverrides();
        input_action.Enable();
        SetWindow(false);
        CleanUp();

        // Hack to refresh pause menu and reset content of all Keybind settings
        transform.parent.gameObject.SetActive(false);
        transform.parent.gameObject.SetActive(true);
    }