封装GUI虚拟按键功能组件
This commit is contained in:
parent
41b0562f7c
commit
f7633ea341
@ -1,27 +0,0 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using System;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput
|
||||
{
|
||||
public abstract class AxiInputUGUIHandleBase : IDisposable
|
||||
{
|
||||
public int Handle { get; private set; }
|
||||
public AxiInputUGuiBtnType UguiBtnType { get; private set; }
|
||||
|
||||
public AxiInputUGUIHandleBase(AxiInputUGuiBtnType uguiBtnType)
|
||||
{
|
||||
|
||||
Handle = AxiInputUGUICenter.GetNextSeed();
|
||||
this.UguiBtnType = uguiBtnType;
|
||||
AxiInputUGUICenter.RegHandle(this);
|
||||
}
|
||||
public abstract bool GetKeyDown();
|
||||
public abstract bool GetKey();
|
||||
public abstract bool GetKeyUp();
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
AxiInputUGUICenter.UnregHandle(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class ColecoVisionMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class GameBoyColorMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class GameBoyMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class GameGearMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -3,7 +3,7 @@ using AxibugEmuOnline.Client.Common;
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class GamingMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
[Flags]
|
||||
public enum EssgeeSingleKey : ushort
|
@ -1,8 +1,9 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using AxiInputSP;
|
||||
using UnityEngine;
|
||||
using VirtualNes.Core;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class NESMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class SC3000MultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class SG1000MultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public enum UMAMEKSingleKey
|
||||
{
|
@ -3,7 +3,7 @@ using AxibugEmuOnline.Client.Common;
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput.Settings
|
||||
namespace AxiInputSP.Setting
|
||||
{
|
||||
public class XMBMultiKeysSetting : MultiKeysSettingBase
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput
|
||||
namespace AxiInputSP
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
public struct AxiInput
|
@ -1,6 +1,8 @@
|
||||
using UnityEngine;
|
||||
using AxiInputSP.Axis;
|
||||
using AxiInputSP.UGUI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput
|
||||
namespace AxiInputSP
|
||||
{
|
||||
public static class AxiInputEx
|
||||
{
|
@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput
|
||||
namespace AxiInputSP.Axis
|
||||
{
|
||||
public static class AxiInputAxisCenter
|
||||
{
|
||||
static long LastCheckFrame = -1;
|
||||
|
||||
public enum AxisState
|
||||
enum AxisState
|
||||
{
|
||||
None,
|
||||
KeyUp,
|
@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AxibugEmuOnline.Client.Common
|
||||
namespace AxiInputSP
|
||||
{
|
||||
public static class PC_XBOXKEY
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AxibugEmuOnline.Client.Common
|
||||
namespace AxiInputSP
|
||||
{
|
||||
public static class PSVitaKey
|
||||
{
|
@ -1,34 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.Script.AppMain.AxiInput
|
||||
namespace AxiInputSP.UGUI
|
||||
{
|
||||
public static class AxiInputUGUICenter
|
||||
{
|
||||
static int handleSeed = 0;
|
||||
static Dictionary<int, AxiInputUGUIHandleBase> dictHandle2AxiUgui = new Dictionary<int, AxiInputUGUIHandleBase>();
|
||||
static Dictionary<AxiInputUGuiBtnType, List<AxiInputUGUIHandleBase>> dictBtnType2BtnList = new Dictionary<AxiInputUGuiBtnType, List<AxiInputUGUIHandleBase>>();
|
||||
static Dictionary<int, AxiInputUGUIHandle> dictHandle2AxiUgui = new Dictionary<int, AxiInputUGUIHandle>();
|
||||
static Dictionary<AxiInputUGuiBtnType, List<AxiInputUGUIHandle>> dictBtnType2BtnList = new Dictionary<AxiInputUGuiBtnType, List<AxiInputUGUIHandle>>();
|
||||
|
||||
public static int GetNextSeed()
|
||||
{
|
||||
return ++handleSeed;
|
||||
}
|
||||
public static void RegHandle(AxiInputUGUIHandleBase uiHandle)
|
||||
public static void RegHandle(AxiInputUGUIHandle uiHandle)
|
||||
{
|
||||
dictHandle2AxiUgui[uiHandle.Handle] = uiHandle;
|
||||
List<AxiInputUGUIHandleBase> list;
|
||||
List<AxiInputUGUIHandle> list;
|
||||
if (dictBtnType2BtnList.TryGetValue(uiHandle.UguiBtnType, out list))
|
||||
list = dictBtnType2BtnList[uiHandle.UguiBtnType] = new List<AxiInputUGUIHandleBase>();
|
||||
list = dictBtnType2BtnList[uiHandle.UguiBtnType] = new List<AxiInputUGUIHandle>();
|
||||
|
||||
if (!list.Contains(uiHandle))
|
||||
list.Add(uiHandle);
|
||||
}
|
||||
public static void UnregHandle(AxiInputUGUIHandleBase uiHandle)
|
||||
public static void UnregHandle(AxiInputUGUIHandle uiHandle)
|
||||
{
|
||||
if (!dictHandle2AxiUgui.ContainsKey(uiHandle.Handle))
|
||||
return;
|
||||
dictHandle2AxiUgui.Remove(uiHandle.Handle);
|
||||
|
||||
List<AxiInputUGUIHandleBase> list;
|
||||
List<AxiInputUGUIHandle> list;
|
||||
if (dictBtnType2BtnList.TryGetValue(uiHandle.UguiBtnType, out list))
|
||||
{
|
||||
if (list.Contains(uiHandle))
|
||||
@ -38,7 +38,7 @@ namespace Assets.Script.AppMain.AxiInput
|
||||
|
||||
public static bool GetKeyUp(AxiInputUGuiBtnType btntype)
|
||||
{
|
||||
List<AxiInputUGUIHandleBase> list;
|
||||
List<AxiInputUGUIHandle> list;
|
||||
if (!dictBtnType2BtnList.TryGetValue(btntype, out list))
|
||||
return false;
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
@ -51,7 +51,7 @@ namespace Assets.Script.AppMain.AxiInput
|
||||
|
||||
public static bool GetKeyDown(AxiInputUGuiBtnType btntype)
|
||||
{
|
||||
List<AxiInputUGUIHandleBase> list;
|
||||
List<AxiInputUGUIHandle> list;
|
||||
if (!dictBtnType2BtnList.TryGetValue(btntype, out list))
|
||||
return false;
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
@ -64,7 +64,7 @@ namespace Assets.Script.AppMain.AxiInput
|
||||
|
||||
public static bool GetKey(AxiInputUGuiBtnType btntype)
|
||||
{
|
||||
List<AxiInputUGUIHandleBase> list;
|
||||
List<AxiInputUGUIHandle> list;
|
||||
if (!dictBtnType2BtnList.TryGetValue(btntype, out list))
|
||||
return false;
|
||||
for (int i = 0; i < list.Count; i++)
|
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace AxiInputSP.UGUI
|
||||
{
|
||||
public class AxiInputUGUIHandle
|
||||
{
|
||||
public int Handle { get; private set; }
|
||||
public AxiInputUGuiBtnType UguiBtnType { get; private set; }
|
||||
|
||||
public AxiInputUGUIHandle(AxiInputUGuiBtnType uguiBtnType)
|
||||
{
|
||||
Handle = AxiInputUGUICenter.GetNextSeed();
|
||||
this.UguiBtnType = uguiBtnType;
|
||||
AxiInputUGUICenter.RegHandle(this);
|
||||
}
|
||||
public bool GetKey()
|
||||
{
|
||||
return GetKeyHandle != null ? GetKeyHandle.Invoke() : false;
|
||||
}
|
||||
public bool GetKeyUp()
|
||||
{
|
||||
return GetKeyUpHandle != null ? GetKeyUpHandle.Invoke() : false;
|
||||
}
|
||||
public bool GetKeyDown()
|
||||
{
|
||||
return GetKeyDownHandle != null ? GetKeyDownHandle.Invoke() : false;
|
||||
}
|
||||
public Func<bool> GetKeyHandle;
|
||||
public Func<bool> GetKeyUpHandle;
|
||||
public Func<bool> GetKeyDownHandle;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GetKeyHandle = null;
|
||||
GetKeyUpHandle = null;
|
||||
GetKeyDownHandle = null;
|
||||
AxiInputUGUICenter.UnregHandle(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace AxiInputSP.UGUI
|
||||
{
|
||||
public class AxiIptButton : UnityEngine.UI.Button
|
||||
{
|
||||
enum AxiButtonState
|
||||
{
|
||||
None,
|
||||
KeyUp,
|
||||
KeyDown,
|
||||
KeyHold
|
||||
}
|
||||
|
||||
AxiInputUGUIHandle[] handles;
|
||||
AxiButtonState m_state = AxiButtonState.None;
|
||||
/// <summary>
|
||||
/// 键值(支持组合键)
|
||||
/// </summary>
|
||||
public AxiInputUGuiBtnType[] axiBtnTypeList;
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
if (axiBtnTypeList != null)
|
||||
{
|
||||
handles = new AxiInputUGUIHandle[axiBtnTypeList.Length];
|
||||
for (int i = 0; i < axiBtnTypeList.Length; i++)
|
||||
{
|
||||
handles[i] = new AxiInputUGUIHandle(axiBtnTypeList[i]);
|
||||
handles[i].GetKeyHandle = GetKey;
|
||||
handles[i].GetKeyUpHandle = GetKeyUp;
|
||||
handles[i].GetKeyDownHandle = GetKeyDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
if (axiBtnTypeList != null)
|
||||
{
|
||||
handles = new AxiInputUGUIHandle[axiBtnTypeList.Length];
|
||||
for (int i = 0; i < axiBtnTypeList.Length; i++)
|
||||
{
|
||||
handles[i].Dispose();
|
||||
handles[i] = null;
|
||||
}
|
||||
axiBtnTypeList = null;
|
||||
handles = null;
|
||||
}
|
||||
|
||||
}
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
}
|
||||
|
||||
bool GetKey()
|
||||
{
|
||||
return m_state >= AxiButtonState.KeyDown;
|
||||
}
|
||||
bool GetKeyUp()
|
||||
{
|
||||
return m_state == AxiButtonState.KeyUp;
|
||||
}
|
||||
bool GetKeyDown()
|
||||
{
|
||||
return m_state == AxiButtonState.KeyDown;
|
||||
}
|
||||
|
||||
public override void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
base.OnPointerDown(eventData);
|
||||
//如果之前帧是KeyUp或None,则为KeyDown|KeyHold
|
||||
if (m_state <= AxiButtonState.KeyUp)
|
||||
m_state = AxiButtonState.KeyDown;
|
||||
//如果之前帧是KeyDown,则为KeyHold
|
||||
else if (m_state == AxiButtonState.KeyDown)
|
||||
m_state = AxiButtonState.KeyHold;
|
||||
}
|
||||
public override void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
base.OnPointerUp(eventData);
|
||||
//如果之前帧是KeyDown|KeyHold,则为KeyUp|None
|
||||
if (m_state >= AxiButtonState.KeyDown)
|
||||
m_state = AxiButtonState.KeyUp;
|
||||
//如果之前帧是KeyUp,则为None
|
||||
else if (m_state == AxiButtonState.KeyUp)
|
||||
m_state = AxiButtonState.None;
|
||||
}
|
||||
}
|
||||
}
|
@ -201,27 +201,27 @@ namespace AxibugEmuOnline.Client
|
||||
// MIC.IsDown;
|
||||
}
|
||||
|
||||
public static KeyListener GetKey(int controllerInput, EnumButtonType nesConBtnType)
|
||||
{
|
||||
string configKey = $"NES_{controllerInput}_{nesConBtnType}";
|
||||
//public static KeyListener GetKey(int controllerInput, EnumButtonType nesConBtnType)
|
||||
//{
|
||||
// string configKey = $"NES_{controllerInput}_{nesConBtnType}";
|
||||
|
||||
//PSV平台固定键值
|
||||
if (UnityEngine.Application.platform == RuntimePlatform.PSP2)
|
||||
{
|
||||
return KeyListener.GetPSVitaKey(controllerInput, nesConBtnType);
|
||||
}
|
||||
// //PSV平台固定键值
|
||||
// if (UnityEngine.Application.platform == RuntimePlatform.PSP2)
|
||||
// {
|
||||
// return KeyListener.GetPSVitaKey(controllerInput, nesConBtnType);
|
||||
// }
|
||||
|
||||
if (PlayerPrefs.HasKey(configKey))
|
||||
{
|
||||
return new KeyListener(PlayerPrefs.GetString(configKey));
|
||||
}
|
||||
else
|
||||
{
|
||||
var defaultKeyCode = KeyListener.GetDefaultKey(controllerInput, nesConBtnType);
|
||||
PlayerPrefs.SetString(configKey, defaultKeyCode.ToString());
|
||||
return defaultKeyCode;
|
||||
}
|
||||
}
|
||||
// if (PlayerPrefs.HasKey(configKey))
|
||||
// {
|
||||
// return new KeyListener(PlayerPrefs.GetString(configKey));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var defaultKeyCode = KeyListener.GetDefaultKey(controllerInput, nesConBtnType);
|
||||
// PlayerPrefs.SetString(configKey, defaultKeyCode.ToString());
|
||||
// return defaultKeyCode;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
@ -268,127 +268,127 @@ namespace AxibugEmuOnline.Client
|
||||
//low C# readonly
|
||||
//public readonly struct KeyListener
|
||||
|
||||
public struct KeyListener
|
||||
{
|
||||
private readonly KeyCode m_key;
|
||||
//public struct KeyListener
|
||||
//{
|
||||
// private readonly KeyCode m_key;
|
||||
|
||||
public KeyListener(KeyCode key)
|
||||
{
|
||||
m_key = key;
|
||||
}
|
||||
// public KeyListener(KeyCode key)
|
||||
// {
|
||||
// m_key = key;
|
||||
// }
|
||||
|
||||
/// <summary> 从配置字符串构建 </summary>
|
||||
public KeyListener(string confStr)
|
||||
{
|
||||
m_key = KeyCode.None;
|
||||
// /// <summary> 从配置字符串构建 </summary>
|
||||
// public KeyListener(string confStr)
|
||||
// {
|
||||
// m_key = KeyCode.None;
|
||||
|
||||
int result;
|
||||
if (int.TryParse(confStr, out result))
|
||||
m_key = (KeyCode)result;
|
||||
}
|
||||
// int result;
|
||||
// if (int.TryParse(confStr, out result))
|
||||
// m_key = (KeyCode)result;
|
||||
// }
|
||||
|
||||
public bool IsPressing()
|
||||
{
|
||||
return Input.GetKey(m_key);
|
||||
}
|
||||
public bool IsDown()
|
||||
{
|
||||
return Input.GetKeyDown(m_key);
|
||||
}
|
||||
// public bool IsPressing()
|
||||
// {
|
||||
// return Input.GetKey(m_key);
|
||||
// }
|
||||
// public bool IsDown()
|
||||
// {
|
||||
// return Input.GetKeyDown(m_key);
|
||||
// }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ((int)(m_key)).ToString();
|
||||
}
|
||||
// public override string ToString()
|
||||
// {
|
||||
// return ((int)(m_key)).ToString();
|
||||
// }
|
||||
|
||||
public static KeyListener GetDefaultKey(int controllerIndex, EnumButtonType nesConBtnType)
|
||||
{
|
||||
switch (controllerIndex)
|
||||
{
|
||||
case 0:
|
||||
switch (nesConBtnType)
|
||||
{
|
||||
case EnumButtonType.LEFT:
|
||||
return new KeyListener(KeyCode.A);
|
||||
case EnumButtonType.RIGHT:
|
||||
return new KeyListener(KeyCode.D);
|
||||
case EnumButtonType.UP:
|
||||
return new KeyListener(KeyCode.W);
|
||||
case EnumButtonType.DOWN:
|
||||
return new KeyListener(KeyCode.S);
|
||||
case EnumButtonType.START:
|
||||
return new KeyListener(KeyCode.B);
|
||||
case EnumButtonType.SELECT:
|
||||
return new KeyListener(KeyCode.V);
|
||||
case EnumButtonType.A:
|
||||
return new KeyListener(KeyCode.K);
|
||||
case EnumButtonType.B:
|
||||
return new KeyListener(KeyCode.J);
|
||||
case EnumButtonType.MIC:
|
||||
return new KeyListener(KeyCode.M);
|
||||
}
|
||||
// public static KeyListener GetDefaultKey(int controllerIndex, EnumButtonType nesConBtnType)
|
||||
// {
|
||||
// switch (controllerIndex)
|
||||
// {
|
||||
// case 0:
|
||||
// switch (nesConBtnType)
|
||||
// {
|
||||
// case EnumButtonType.LEFT:
|
||||
// return new KeyListener(KeyCode.A);
|
||||
// case EnumButtonType.RIGHT:
|
||||
// return new KeyListener(KeyCode.D);
|
||||
// case EnumButtonType.UP:
|
||||
// return new KeyListener(KeyCode.W);
|
||||
// case EnumButtonType.DOWN:
|
||||
// return new KeyListener(KeyCode.S);
|
||||
// case EnumButtonType.START:
|
||||
// return new KeyListener(KeyCode.B);
|
||||
// case EnumButtonType.SELECT:
|
||||
// return new KeyListener(KeyCode.V);
|
||||
// case EnumButtonType.A:
|
||||
// return new KeyListener(KeyCode.K);
|
||||
// case EnumButtonType.B:
|
||||
// return new KeyListener(KeyCode.J);
|
||||
// case EnumButtonType.MIC:
|
||||
// return new KeyListener(KeyCode.M);
|
||||
// }
|
||||
|
||||
break;
|
||||
case 1:
|
||||
switch (nesConBtnType)
|
||||
{
|
||||
case EnumButtonType.LEFT:
|
||||
return new KeyListener(KeyCode.Delete);
|
||||
case EnumButtonType.RIGHT:
|
||||
return new KeyListener(KeyCode.PageDown);
|
||||
case EnumButtonType.UP:
|
||||
return new KeyListener(KeyCode.Home);
|
||||
case EnumButtonType.DOWN:
|
||||
return new KeyListener(KeyCode.End);
|
||||
case EnumButtonType.START:
|
||||
return new KeyListener(KeyCode.PageUp);
|
||||
case EnumButtonType.SELECT:
|
||||
return new KeyListener(KeyCode.Insert);
|
||||
case EnumButtonType.A:
|
||||
return new KeyListener(KeyCode.Keypad5);
|
||||
case EnumButtonType.B:
|
||||
return new KeyListener(KeyCode.Keypad4);
|
||||
case EnumButtonType.MIC:
|
||||
return new KeyListener(KeyCode.KeypadPeriod);
|
||||
}
|
||||
// break;
|
||||
// case 1:
|
||||
// switch (nesConBtnType)
|
||||
// {
|
||||
// case EnumButtonType.LEFT:
|
||||
// return new KeyListener(KeyCode.Delete);
|
||||
// case EnumButtonType.RIGHT:
|
||||
// return new KeyListener(KeyCode.PageDown);
|
||||
// case EnumButtonType.UP:
|
||||
// return new KeyListener(KeyCode.Home);
|
||||
// case EnumButtonType.DOWN:
|
||||
// return new KeyListener(KeyCode.End);
|
||||
// case EnumButtonType.START:
|
||||
// return new KeyListener(KeyCode.PageUp);
|
||||
// case EnumButtonType.SELECT:
|
||||
// return new KeyListener(KeyCode.Insert);
|
||||
// case EnumButtonType.A:
|
||||
// return new KeyListener(KeyCode.Keypad5);
|
||||
// case EnumButtonType.B:
|
||||
// return new KeyListener(KeyCode.Keypad4);
|
||||
// case EnumButtonType.MIC:
|
||||
// return new KeyListener(KeyCode.KeypadPeriod);
|
||||
// }
|
||||
|
||||
break;
|
||||
}
|
||||
// break;
|
||||
// }
|
||||
|
||||
return default(KeyListener);
|
||||
}
|
||||
// return default(KeyListener);
|
||||
// }
|
||||
|
||||
|
||||
public static KeyListener GetPSVitaKey(int controllerIndex, EnumButtonType nesConBtnType)
|
||||
{
|
||||
switch (controllerIndex)
|
||||
{
|
||||
case 0:
|
||||
switch (nesConBtnType)
|
||||
{
|
||||
case EnumButtonType.LEFT:
|
||||
return new KeyListener(PSVitaKey.Left);
|
||||
case EnumButtonType.RIGHT:
|
||||
return new KeyListener(PSVitaKey.Right);
|
||||
case EnumButtonType.UP:
|
||||
return new KeyListener(PSVitaKey.Up);
|
||||
case EnumButtonType.DOWN:
|
||||
return new KeyListener(PSVitaKey.Down);
|
||||
case EnumButtonType.START:
|
||||
return new KeyListener(PSVitaKey.Start);
|
||||
case EnumButtonType.SELECT:
|
||||
return new KeyListener(PSVitaKey.Select);
|
||||
case EnumButtonType.A:
|
||||
return new KeyListener(PSVitaKey.Circle);
|
||||
case EnumButtonType.B:
|
||||
return new KeyListener(PSVitaKey.Cross);
|
||||
case EnumButtonType.MIC:
|
||||
return new KeyListener(PSVitaKey.Block);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return default(KeyListener);
|
||||
}
|
||||
}
|
||||
// //public static KeyListener GetPSVitaKey(int controllerIndex, EnumButtonType nesConBtnType)
|
||||
// //{
|
||||
// // switch (controllerIndex)
|
||||
// // {
|
||||
// // case 0:
|
||||
// // switch (nesConBtnType)
|
||||
// // {
|
||||
// // case EnumButtonType.LEFT:
|
||||
// // return new KeyListener(PSVitaKey.Left);
|
||||
// // case EnumButtonType.RIGHT:
|
||||
// // return new KeyListener(PSVitaKey.Right);
|
||||
// // case EnumButtonType.UP:
|
||||
// // return new KeyListener(PSVitaKey.Up);
|
||||
// // case EnumButtonType.DOWN:
|
||||
// // return new KeyListener(PSVitaKey.Down);
|
||||
// // case EnumButtonType.START:
|
||||
// // return new KeyListener(PSVitaKey.Start);
|
||||
// // case EnumButtonType.SELECT:
|
||||
// // return new KeyListener(PSVitaKey.Select);
|
||||
// // case EnumButtonType.A:
|
||||
// // return new KeyListener(PSVitaKey.Circle);
|
||||
// // case EnumButtonType.B:
|
||||
// // return new KeyListener(PSVitaKey.Cross);
|
||||
// // case EnumButtonType.MIC:
|
||||
// // return new KeyListener(PSVitaKey.Block);
|
||||
// // }
|
||||
// // break;
|
||||
// // }
|
||||
// // return default(KeyListener);
|
||||
// //}
|
||||
//}
|
||||
}
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
using Assets.Script.AppMain.AxiInput.Settings;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using System;
|
||||
|
||||
namespace AxibugEmuOnline.Client
|
||||
{
|
||||
|
@ -1,7 +1,5 @@
|
||||
using Assets.Script.AppMain.AxiInput.Settings;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using System;
|
||||
|
||||
namespace AxibugEmuOnline.Client
|
||||
{
|
||||
|
@ -1,11 +1,9 @@
|
||||
using Assets.Script.AppMain.AxiInput;
|
||||
using Assets.Script.AppMain.AxiInput.Settings;
|
||||
using AxibugEmuOnline.Client.Common;
|
||||
using AxibugEmuOnline.Client.Common;
|
||||
using AxiInputSP;
|
||||
using AxiInputSP.Setting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements.Experimental;
|
||||
|
||||
namespace AxibugEmuOnline.Client.Manager
|
||||
{
|
||||
|
@ -1,11 +1,8 @@
|
||||
using Assets.Script.AppMain.AxiInput;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using AxibugEmuOnline.Client.Manager;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using static UnityEditor.Progress;
|
||||
|
||||
namespace AxibugEmuOnline.Client
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user