Ejemplo n.º 1
0
    void PressButton()
    {
        string interact = "Interact" + GetComponentInParent <PlayerPlatformerController> ().playerNum;

        InputBroker.SetButtonDown(interact);

        //Jump
        GetComponentInParent <PlayerPlatformerController> ().Jump();
    }
Ejemplo n.º 2
0
    void HandlePadPress(object sender, ClickedEventArgs e)
    {
        var tracked = sender as SteamVR_TrackedController;
        var device  = SteamVR_Controller.Input((int)tracked.controllerIndex);
        var x       = e.padX;
        var y       = e.padY;

        if (System.Math.Abs(x) > System.Math.Abs(y))
        {
            if (x > 0)
            {
                // right
                input.SetButtonDown("Button2");
                device.TriggerHapticPulse(1000);
            }
            else
            {
                // left
                input.SetButtonDown("Button4");
                device.TriggerHapticPulse(1000);
            }
        }
        else
        {
            if (y > 0)
            {
                // up
                input.SetButtonDown("Button1");
            }
            else
            {
                // down
                input.SetButtonDown("Button3");
            }
        }
    }