From 3797bba442e4b456d9104a2e7292055afea567c0 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" <alienjack@foxmail.com> Date: Thu, 27 Mar 2025 20:13:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84GamePad=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InputDevicesManager/Devices/GamePad_D.cs | 2 +- .../InputResolver/InputSystemResolver.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/Devices/GamePad_D.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/Devices/GamePad_D.cs index 9792afa8..1834a25c 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/Devices/GamePad_D.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/Devices/GamePad_D.cs @@ -9,7 +9,7 @@ public Button_C Down; public Button_C Left; public Button_C Right; - public Button_C Option; + public Button_C Select; public Button_C Start; public Button_C North; public Button_C South; diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputResolver/InputSystemResolver.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputResolver/InputSystemResolver.cs index f89f87ca..9ac5ddeb 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputResolver/InputSystemResolver.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputResolver/InputSystemResolver.cs @@ -1,5 +1,8 @@ #if ENABLE_INPUT_SYSTEM +using Google.Protobuf.WellKnownTypes; +using NUnit.Framework.Internal; using System.Collections.Generic; +using UnityEditor.Experimental.GraphView; using UnityEngine; using UnityEngine.InputSystem; @@ -222,6 +225,23 @@ namespace AxibugEmuOnline.Client.InputDevices.ForInputSystem { var ipGamepad = ipdevice as Gamepad; mapper[gamepad_d.Up] = ipGamepad.dpad.up; + mapper[gamepad_d.Down] = ipGamepad.dpad.down; + mapper[gamepad_d.Left] = ipGamepad.dpad.left; + mapper[gamepad_d.Right] = ipGamepad.dpad.right; + mapper[gamepad_d.Select] = ipGamepad.selectButton; + mapper[gamepad_d.Start] = ipGamepad.startButton; + mapper[gamepad_d.North] = ipGamepad.buttonNorth; + mapper[gamepad_d.South] = ipGamepad.buttonSouth; + mapper[gamepad_d.West] = ipGamepad.buttonWest; + mapper[gamepad_d.East] = ipGamepad.buttonEast; + mapper[gamepad_d.LeftShoulder] = ipGamepad.leftShoulder; + mapper[gamepad_d.RightShoulder] = ipGamepad.rightShoulder; + mapper[gamepad_d.LeftTrigger] = ipGamepad.leftTrigger; + mapper[gamepad_d.RightTrigger] = ipGamepad.rightTrigger; + mapper[gamepad_d.LeftStickPress] = ipGamepad.leftStickButton; + mapper[gamepad_d.RightStickPress] = ipGamepad.rightStickButton; + mapper[gamepad_d.LeftStick] = ipGamepad.leftStick; + mapper[gamepad_d.RightStick] = ipGamepad.rightStick; } else throw new System.NotImplementedException($"初始化设备失败,未实现的物理按键映射 for {device_d.GetType()}"); }