Esempio n. 1
0
        /** 更新。インプットマネージャ。インプットネーム。パッドトリガー。
         */
        private bool Main_InputManager_InputName_PadTrigger(ref Pad_Status a_pad_status)
        {
            //デバイス。
            bool  t_l_1 = UnityEngine.Input.GetButton(Config.INPUTMANAGER_LT1.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool  t_r_1 = UnityEngine.Input.GetButton(Config.INPUTMANAGER_RT1.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            float t_l_2 = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_LT2.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            float t_r_2 = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_RT2.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));

            if (t_l_2 < 0.0f)
            {
                t_l_2 = 0.0f;
            }

            if (t_r_2 < 0.0f)
            {
                t_r_2 = 0.0f;
            }

            //設定。
            a_pad_status.l_trigger_1.Set(t_l_1 & this.is_focus);
            a_pad_status.r_trigger_1.Set(t_r_1 & this.is_focus);
            if (this.is_focus == true)
            {
                a_pad_status.l_trigger_2.Set(t_l_2);
                a_pad_status.r_trigger_2.Set(t_r_2);
            }
            else
            {
                a_pad_status.l_trigger_2.Set(0.0f);
                a_pad_status.r_trigger_2.Set(0.0f);
            }

            return(true);
        }
Esempio n. 2
0
        /** 更新。インプットシステム。ゲームパッド。パッドモーター。
         */
        private bool Main_InputSystem_GamePad_PadMotor(ref Pad_Status a_pad_status)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Gamepad t_gamepad = this.GetPadDevice(a_pad_status.pad_index);
                if (t_gamepad != null)
                {
                    float t_value_low      = a_pad_status.moter_low.GetValue();
                    float t_value_high     = a_pad_status.moter_high.GetValue();
                    float t_raw_value_low  = a_pad_status.moter_low.GetRawValue();
                    float t_raw_value_high = a_pad_status.moter_high.GetRawValue();

                    {
                        a_pad_status.moter_low.SetRawValue(t_value_low);
                        a_pad_status.moter_high.SetRawValue(t_value_high);
                        t_gamepad.SetMotorSpeeds(t_value_low, t_value_high);
                    }

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Esempio n. 3
0
        /** 更新。インプットシステム。ゲームパッド。パッドトリガー。
         */
        private bool Main_InputSystem_GamePad_PadTrigger(ref Pad_Status a_pad_status)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Gamepad t_gamepad = this.GetPadDevice(a_pad_status.pad_index);
                if (t_gamepad != null)
                {
                    //デバイス。
                    bool  t_l_1 = t_gamepad.leftShoulder.isPressed;
                    bool  t_r_1 = t_gamepad.rightShoulder.isPressed;
                    float t_l_2 = t_gamepad.leftTrigger.ReadValue();
                    float t_r_2 = t_gamepad.rightTrigger.ReadValue();

                    //設定。
                    a_pad_status.l_trigger_1.Set(t_l_1 & this.is_focus);
                    a_pad_status.r_trigger_1.Set(t_r_1 & this.is_focus);
                    if (this.is_focus == true)
                    {
                        a_pad_status.l_trigger_2.Set(t_l_2);
                        a_pad_status.r_trigger_2.Set(t_r_2);
                    }
                    else
                    {
                        a_pad_status.l_trigger_2.Set(0.0f);
                        a_pad_status.r_trigger_2.Set(0.0f);
                    }

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Esempio n. 4
0
        /** 更新。インプットマネージャ。インプットネーム。パッドスティック。
         */
        private bool Main_InputManager_InputName_PadStick(ref Pad_Status a_pad_status)
        {
            //デバイス。
            float t_l_x  = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_LSX.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            float t_l_y  = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_LSY.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            float t_r_x  = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_RSX.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            float t_r_y  = UnityEngine.Input.GetAxis(Config.INPUTMANAGER_RSY.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool  t_l_on = UnityEngine.Input.GetButton(Config.INPUTMANAGER_LSB.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool  t_r_on = UnityEngine.Input.GetButton(Config.INPUTMANAGER_RSB.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));

            //設定。
            if (this.is_focus == true)
            {
                a_pad_status.l_stick.Set(t_l_x, t_l_y);
                a_pad_status.r_stick.Set(t_r_x, t_r_y);
            }
            else
            {
                a_pad_status.l_stick.Set(0.0f, 0.0f);
                a_pad_status.r_stick.Set(0.0f, 0.0f);
            }
            a_pad_status.l_stick_button.Set(t_l_on & this.is_focus);
            a_pad_status.r_stick_button.Set(t_r_on & this.is_focus);

            //devicename
            a_pad_status.devicename = "inputname";

            return(true);
        }
Esempio n. 5
0
        /** 更新。インプットマネージャ。インプットネーム。パッドデジタルボタン。
         */
                #if (true)
        private bool Main_InputManager_InputName_PadDigitalButton(ref Pad_Status a_pad_status)
        {
            bool t_left_on  = (UnityEngine.Input.GetAxis(Config.INPUTMANAGER_LEFT.GetItem(a_pad_status.pad_index, a_pad_status.pad_type)) < -0.5f) ? true : false;
            bool t_right_on = (UnityEngine.Input.GetAxis(Config.INPUTMANAGER_RIGHT.GetItem(a_pad_status.pad_index, a_pad_status.pad_type)) > 0.5f) ? true : false;
            bool t_up_on    = (UnityEngine.Input.GetAxis(Config.INPUTMANAGER_UP.GetItem(a_pad_status.pad_index, a_pad_status.pad_type)) > 0.5f) ? true : false;
            bool t_down_on  = (UnityEngine.Input.GetAxis(Config.INPUTMANAGER_DOWN.GetItem(a_pad_status.pad_index, a_pad_status.pad_type)) < -0.5f) ? true : false;

            bool t_enter_on      = UnityEngine.Input.GetButton(Config.INPUTMANAGER_ENTER.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool t_escape_on     = UnityEngine.Input.GetButton(Config.INPUTMANAGER_ESCAPE.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool t_sub1_on       = UnityEngine.Input.GetButton(Config.INPUTMANAGER_SUB1.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool t_sub2_on       = UnityEngine.Input.GetButton(Config.INPUTMANAGER_SUB2.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool t_left_menu_on  = UnityEngine.Input.GetButton(Config.INPUTMANAGER_LMENU.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));
            bool t_right_menu_on = UnityEngine.Input.GetButton(Config.INPUTMANAGER_RMENU.GetItem(a_pad_status.pad_index, a_pad_status.pad_type));

            //設定。
            a_pad_status.left.Set(t_left_on & this.is_focus);
            a_pad_status.right.Set(t_right_on & this.is_focus);
            a_pad_status.up.Set(t_up_on & this.is_focus);
            a_pad_status.down.Set(t_down_on & this.is_focus);
            a_pad_status.enter.Set(t_enter_on & this.is_focus);
            a_pad_status.escape.Set(t_escape_on & this.is_focus);
            a_pad_status.sub1.Set(t_sub1_on & this.is_focus);
            a_pad_status.sub2.Set(t_sub2_on & this.is_focus);
            a_pad_status.left_menu.Set(t_left_menu_on & this.is_focus);
            a_pad_status.right_menu.Set(t_right_menu_on & this.is_focus);

            return(true);
        }
Esempio n. 6
0
 /** 更新。モータ。
  */
 private void Main_Moter(ref Pad_Status a_pad_status)
 {
     //インプットシステム。ゲームパッド。パッドモーター。
     if (Config.USE_INPUTSYSTEM_GAMEPAD_PADMOTOR == true)
     {
         if (this.Main_InputSystem_GamePad_PadMotor(ref a_pad_status) == true)
         {
             return;
         }
     }
 }
Esempio n. 7
0
        /** 更新。トリガー。
         */
        private void Main_Trigger(ref Pad_Status a_pad_status)
        {
            //インプットシステム。ゲームパッド。パッドトリガー。
            if (Config.USE_INPUTSYSTEM_GAMEPAD_PADTRIGGER == true)
            {
                if (this.Main_InputSystem_GamePad_PadTrigger(ref a_pad_status) == true)
                {
                    return;
                }
            }

            //インプットマネージャ。インプットネーム。パッドトリガー。
            if (Config.USE_INPUTMANAGER_INPUTNAME_PADTRIGGER == true)
            {
                if (this.Main_InputManager_InputName_PadTrigger(ref a_pad_status) == true)
                {
                    return;
                }
            }
        }
Esempio n. 8
0
        /** 更新。デジタルボタン。
         */
        private void Main_DigitalButton(ref Pad_Status a_pad_status)
        {
            //インプットシステム。ゲームパッド。パッドデジタルボタン。
            if (Config.USE_INPUTSYSTEM_GAMEPAD_PADDIGITALBUTTON == true)
            {
                if (this.Main_InputSystem_GamePad_PadDigitalButton(ref a_pad_status) == true)
                {
                    return;
                }
            }

            //インプットマネージャ。インプットネーム。パッドデジタルボタン。
            if (Config.USE_INPUTMANAGER_INPUTNAME_PADDIGITALBUTTON == true)
            {
                if (this.Main_InputManager_InputName_PadDigitalButton(ref a_pad_status) == true)
                {
                    return;
                }
            }
        }
Esempio n. 9
0
        /** 更新。インプットシステム。ゲームパッド。パッドスティック。
         */
        private bool Main_InputSystem_GamePad_PadStick(ref Pad_Status a_pad_status)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Gamepad t_gamepad = this.GetPadDevice(a_pad_status.pad_index);
                if (t_gamepad != null)
                {
                    //デバイス。
                    float t_l_x  = t_gamepad.leftStick.x.ReadValue();
                    float t_l_y  = t_gamepad.leftStick.y.ReadValue();
                    float t_r_x  = t_gamepad.rightStick.x.ReadValue();
                    float t_r_y  = t_gamepad.rightStick.y.ReadValue();
                    bool  t_l_on = t_gamepad.leftStickButton.isPressed;
                    bool  t_r_on = t_gamepad.rightStickButton.isPressed;

                    //設定。
                    if (this.is_focus == true)
                    {
                        a_pad_status.l_stick.Set(t_l_x, t_l_y);
                        a_pad_status.r_stick.Set(t_r_x, t_r_y);
                    }
                    else
                    {
                        a_pad_status.l_stick.Set(0.0f, 0.0f);
                        a_pad_status.r_stick.Set(0.0f, 0.0f);
                    }
                    a_pad_status.l_stick_button.Set(t_l_on & this.is_focus);
                    a_pad_status.r_stick_button.Set(t_r_on & this.is_focus);

                    //devicename
                    a_pad_status.devicename = t_gamepad.displayName;

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Esempio n. 10
0
        /** 更新。インプットシステム。ゲームパッド。パッドデジタルボタン。
         */
        private bool Main_InputSystem_GamePad_PadDigitalButton(ref Pad_Status a_pad_status)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Gamepad t_gamepad = this.GetPadDevice(a_pad_status.pad_index);
                if (t_gamepad != null)
                {
                    //デバイス。
                    bool t_left_on       = t_gamepad.dpad.left.isPressed;
                    bool t_right_on      = t_gamepad.dpad.right.isPressed;
                    bool t_up_on         = t_gamepad.dpad.up.isPressed;
                    bool t_down_on       = t_gamepad.dpad.down.isPressed;
                    bool t_enter_on      = t_gamepad.buttonEast.isPressed;
                    bool t_escape_on     = t_gamepad.buttonSouth.isPressed;
                    bool t_sub1_on       = t_gamepad.buttonNorth.isPressed;
                    bool t_sub2_on       = t_gamepad.buttonWest.isPressed;
                    bool t_left_menu_on  = t_gamepad.selectButton.isPressed;
                    bool t_right_menu_on = t_gamepad.startButton.isPressed;

                    //設定。
                    a_pad_status.left.Set(t_left_on & this.is_focus);
                    a_pad_status.right.Set(t_right_on & this.is_focus);
                    a_pad_status.up.Set(t_up_on & this.is_focus);
                    a_pad_status.down.Set(t_down_on & this.is_focus);
                    a_pad_status.enter.Set(t_enter_on & this.is_focus);
                    a_pad_status.escape.Set(t_escape_on & this.is_focus);
                    a_pad_status.sub1.Set(t_sub1_on & this.is_focus);
                    a_pad_status.sub2.Set(t_sub2_on & this.is_focus);
                    a_pad_status.left_menu.Set(t_left_menu_on & this.is_focus);
                    a_pad_status.right_menu.Set(t_right_menu_on & this.is_focus);

                    return(true);
                }
            }
                        #endif

            return(false);
        }