From 44892a25a4391a64f91d00332151ad3db57cc271 Mon Sep 17 00:00:00 2001 From: unitydavidlo Date: Thu, 19 Nov 2026 09:55:09 +0000 Subject: [PATCH] FIX: [Port] Fixed CS0117 'remoteConnection' compile error in release Player builds with UNITY_INCLUDE_TESTS InputSystemTestHooks.cs compiles under UNITY_EDITOR || UNITY_INCLUDE_TESTS but accessed InputSystem.remoteConnection, which was only declared under #if DEBUG. Non-development Player builds with UNITY_INCLUDE_TESTS failed to compile. Port of the guard change from trunk (ISX-2788): remoteConnection is always declared, and remoting is enabled in Players based on Debug.isDebugBuild. Co-Authored-By: Claude Opus 5.5 --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../InputSystem/Runtime/InputSystem.cs | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 853311de65..d958c22c6a 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the Player Input component Inspector not showing the action map events after the Behavior is set to Invoke Unity Events, until the GameObject was selected again. [UUM-150956](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-150956) - Fixed a control declared for several variants at once (for example `"variants" : "A;B"`) only merging with derived layouts under its first variant; derived overrides for the other variants lost the base control's layout, offset, format and usages. [UUM-160829](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-160829) - Fixed duplicate entries appearing in the Input Actions Editor binding path search for some devices, such as Mouse and XR controllers. [UUM-160646](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-160646) +- Fixed compilation error CS0117 (`'InputSystem' does not contain a definition for 'remoteConnection'`) in non-development Player builds when the `UNITY_INCLUDE_TESTS` scripting define symbol is set. ## [1.20.1] - 2026-10-05 diff --git a/Packages/com.unity.inputsystem/InputSystem/Runtime/InputSystem.cs b/Packages/com.unity.inputsystem/InputSystem/Runtime/InputSystem.cs index fce3a22117..8e105b0435 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Runtime/InputSystem.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Runtime/InputSystem.cs @@ -3366,7 +3366,6 @@ public static bool runInBackground internal static InputManager s_Manager; internal static InputRemoting s_Remote; -#if DEBUG private static RemoteInputPlayerConnection s_RemoteConnection; internal static RemoteInputPlayerConnection remoteConnection @@ -3400,19 +3399,15 @@ private static void SetUpRemotingInternal() } } - #if !UNITY_EDITOR private static bool ShouldEnableRemoting() { #if UNITY_INCLUDE_TESTS return false; // Don't remote while running tests. #else - return true; + return Debug.isDebugBuild; #endif } - #endif //!UNITY_EDITOR // -#endif // DEBUG - // The rest here is internal stuff to manage singletons, survive domain reloads, // and to support the reset ability for tests. @@ -3506,10 +3501,8 @@ internal static void InitializeInPlayer(IInputRuntime runtime = null, bool loadS #endif // Automatically enable remoting in development players. - #if DEBUG && !UNITY_EDITOR if (ShouldEnableRemoting()) SetUpRemoting(); - #endif // This is the point where we initialise project-wide actions for the Player EnableActions();