コード例 #1
0
    void dualshock_1_listener()
    {
        string joystick_1 = "joystick 1 ";

        if (Input.GetKeyDown(joystick_1 + "button 4"))
        {
            Debug.Log("Revive! joystick 1");
            p2mm.request_revive();
            pmm.request_revive();
        }
        if (Input.GetKeyDown(KeyCode.Q))
        {
            pmm.request_death();
        }
        if (Input.GetKeyDown(KeyCode.Z))
        {
            pmm.request_landing();
        }
        ////////////////////////////////////
        if (Input.GetKey(joystick_1 + "button 0"))
        {
            pmm.request_jab();
        }

        float x_axis = Input.GetAxis("HorizontalP1");

        ////////////////////////////////////
        if (x_axis < -0.5)
        {
            pmm.request_run_left();
        }
        //pmm.request_run_left();
        if (x_axis > -0.5 && x_axis < 0.5)
        {
            pmm.request_stop_running();
        }
        /////////////////////////////////////
        if (x_axis > 0.5)
        {
            pmm.request_run_right();
        }
        ///////////////////////////////////////

        if (Input.GetKeyDown(joystick_1 + "button 1"))
        {
            pmm.request_jump();
        }
        ///////////////////////////////////////
        if (Input.GetKeyDown(joystick_1 + "button 5"))
        {
            pmm.request_reset_position();
        }
    }