forked from sin365/AxibugEmuOnline
修复GetBinding返回的InputControl对象并不完整的问题
This commit is contained in:
parent
49c893fdab
commit
cf8127c553
@ -2,6 +2,7 @@
|
|||||||
using AxibugEmuOnline.Client.InputDevices;
|
using AxibugEmuOnline.Client.InputDevices;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -307,18 +308,21 @@ namespace AxibugEmuOnline.Client.Settings
|
|||||||
return settingList[settingSlot];
|
return settingList[settingSlot];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<InputDevice.InputControl> m_caches = new List<InputDevice.InputControl>();
|
||||||
public IEnumerable<InputDevice.InputControl> GetBinding(T emuBtn)
|
public IEnumerable<InputDevice.InputControl> GetBinding(T emuBtn)
|
||||||
{
|
{
|
||||||
|
m_caches.Clear();
|
||||||
|
|
||||||
foreach (var mapSettings in m_mapSetting.Values)
|
foreach (var mapSettings in m_mapSetting.Values)
|
||||||
{
|
{
|
||||||
mapSettings.TryGetValue(emuBtn, out var bindControls);
|
mapSettings.TryGetValue(emuBtn, out var bindControls);
|
||||||
if (bindControls != null)
|
if (bindControls != null)
|
||||||
{
|
{
|
||||||
return bindControls;
|
m_caches.AddRange(bindControls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Enumerable.Empty<InputDevice.InputControl>();
|
return m_caches;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AnyKeyDown()
|
public bool AnyKeyDown()
|
||||||
@ -337,5 +341,6 @@ namespace AxibugEmuOnline.Client.Settings
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user