Skip to content

Commit 4afb5c8

Browse files
committed
Linux Bug Fix
1 parent b885481 commit 4afb5c8

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.2] - 2023-08-10
9+
10+
### Fixed
11+
12+
- Fixed a build error on Linux caused by Nintendo Switch Pro controller not being supported on Linux, for some reason.
13+
814
## [1.1.1] - 2023-08-06
915

1016

Runtime/Scripts/InputUtilities.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System.Linq;
2-
using UnityEngine;
3-
using UnityEngine.InputSystem;
1+
using UnityEngine.InputSystem;
42
using UnityEngine.InputSystem.DualShock;
5-
using UnityEngine.InputSystem.Switch;
3+
#if UNITY_EDITOR || UNITY_SWITCH || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WSA
4+
using UnityEngine.InputSystem.Switch; // Switch Pro Controller is not supported on Linux.
5+
#endif
66

77
namespace DartCore.Utilities
88
{
@@ -19,12 +19,17 @@ public static GamepadPlatform GetGamepadPlatform()
1919
return gamepad switch
2020
{
2121
DualShockGamepad => GamepadPlatform.Playstation,
22-
SwitchProControllerHID => GamepadPlatform.Nintendo,
22+
#if UNITY_EDITOR || UNITY_SWITCH || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_WSA
23+
SwitchProControllerHID => GamepadPlatform.Nintendo, // Switch Pro Controller is not supported on Linux.
24+
#endif
2325
_ => GamepadPlatform.Xbox
2426
};
2527
}
2628
}
2729

30+
/// <summary>
31+
/// Switch Pro Controller is not supported on Linux for some reason.
32+
/// </summary>
2833
public enum GamepadPlatform
2934
{
3035
None = 0,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.dartcore.utilities",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"displayName": "DartCore Utilities",
55
"description": "This package contains methods to handle commonly required stuff.",
66
"unity": "2018.1",

0 commit comments

Comments
 (0)