diff --git a/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Source/Controller/GCController.cs b/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Source/Controller/GCController.cs index 6a1be214..5f8e0cb0 100644 --- a/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Source/Controller/GCController.cs +++ b/plug-ins/Apple.GameController/Apple.GameController_Unity/Assets/Apple.GameController/Source/Controller/GCController.cs @@ -175,10 +175,12 @@ public GCBatteryState GetBatteryState() public void Poll() { - _previousButtonPressStates = new Dictionary(_buttonPressStates); - foreach (var key in _buttonPressStates.Keys.ToList()) + _previousButtonPressStates.Clear(); + foreach (var kv in _buttonPressStates) { - _buttonPressStates[key] = false; + _previousButtonPressStates.Add(kv.Key, kv.Value); + _buttonPressStates[kv.Key] = false; + } InputState = IsConnected ? GCControllerService.PollController(Handle) : GCControllerInputState.None; @@ -191,4 +193,5 @@ public void SetLightColor(float red, float green, float blue) GCControllerService.SetControllerLightColor(Handle, red, green, blue); } } -} \ No newline at end of file +} +