Exemplo n.º 1
0
    public void SelectHand(string hand)
    {
        if (hand == "right")
        {
            // enable right hand raycast to equal left
            rhControllerInput.enabled = lhControllerInput.enabled;
            rhRaycastPointer.enabled  = lhRaycastPointer.enabled;

            lhRaycastPointer.DeleteLineRenderer();
            rhRaycastPointer.CreateLineRenderer();

            // disable left hand
            lhRaycastPointer.enabled = false;

            selectedControllerInput = rhControllerInput;
            selectedRaycastPointer  = rhRaycastPointer;
        }
        else
        {
            // enable left hand raycast to equal right
            lhControllerInput.enabled = rhControllerInput.enabled;
            lhRaycastPointer.enabled  = rhRaycastPointer.enabled;

            rhRaycastPointer.DeleteLineRenderer();
            lhRaycastPointer.CreateLineRenderer();

            // disable right hand
            rhRaycastPointer.enabled = false;

            selectedControllerInput = lhControllerInput;
            selectedRaycastPointer  = lhRaycastPointer;
        }
    }
Exemplo n.º 2
0
 public void Awake()
 {
     controller       = new controllerInput();
     controls         = new PlayerControls();
     controls.devices = GetComponent <PlayerInput>().user.pairedDevices;
     controls.Gameplay.move.performed += ctx => controller.move = ctx.ReadValue <Vector2>();
     controls.Gameplay.move.canceled  += ctx => controller.move = Vector2.zero;
     controls.Enable();
 }
Exemplo n.º 3
0
    void Start()
    {
        rhControllerInput = rightHand.GetComponent <controllerInput>();
        rhRaycastPointer  = rightHand.GetComponent <raycastPointer>();

        lhControllerInput = leftHand.GetComponent <controllerInput>();
        lhRaycastPointer  = leftHand.GetComponent <raycastPointer>();

        selectedControllerInput = rhControllerInput;
        selectedRaycastPointer  = rhRaycastPointer;
    }