forked from sin365/AxibugEmuOnline
完善GamePad支持
This commit is contained in:
parent
4e87cfe9ee
commit
3797bba442
@ -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;
|
||||
|
@ -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()}");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user