diff --git a/Assets/Tests/InputSystem/CoreTests_Controls.cs b/Assets/Tests/InputSystem/CoreTests_Controls.cs index 61051d802f..8ee0a4bb33 100644 --- a/Assets/Tests/InputSystem/CoreTests_Controls.cs +++ b/Assets/Tests/InputSystem/CoreTests_Controls.cs @@ -17,6 +17,9 @@ using UnityEngine.Profiling; using UnityEngine.TestTools.Constraints; using Is = NUnit.Framework.Is; +#if UNITY_6000_5_OR_NEWER +using UnityEngine.Assemblies; +#endif partial class CoreTests { @@ -1545,7 +1548,11 @@ public void Controls_PrecompiledLayouts_AllChildControlPropertiesHaveSetters() var inputDevice = typeof(InputDevice); var inputControlType = typeof(InputControl); var checkedTypes = new HashSet(); +#if UNITY_6000_5_OR_NEWER + foreach (var assembly in CurrentAssemblies.GetLoadedAssemblies()) +#else foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) +#endif { try { diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs index eb5afba946..90b5fc5301 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs @@ -11,6 +11,9 @@ using UnityEditor.Compilation; using UnityEditor.UnityLinker; using UnityEngine.InputSystem.Layouts; +#if UNITY_6000_5_OR_NEWER +using UnityEngine.Assemblies; +#endif namespace UnityEngine.InputSystem.Editor { @@ -40,7 +43,11 @@ public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuild var currentAssemblyName = typeof(UnityEngine.InputSystem.InputSystem).Assembly.GetName().Name; var typesByAssemblies = new Dictionary(); +#if UNITY_6000_5_OR_NEWER + var assemblies = CurrentAssemblies.GetLoadedAssemblies(); +#else var assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif foreach (var assembly in assemblies) { try diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs index 2b5d28e7a7..6313b4343c 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs @@ -5,6 +5,9 @@ using UnityEditor.UIElements; using UnityEngine.InputSystem.Utilities; using UnityEngine.UIElements; +#if UNITY_6000_5_OR_NEWER +using UnityEngine.Assemblies; +#endif ////REVIEW: generalize this to something beyond just parameters? @@ -50,7 +53,11 @@ internal static Type LookupEditorForType(Type type) if (s_TypeLookupCache == null) { s_TypeLookupCache = new Dictionary(); +#if UNITY_6000_5_OR_NEWER + foreach (var assembly in CurrentAssemblies.GetLoadedAssemblies()) +#else foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) +#endif { foreach (var typeInfo in assembly.DefinedTypes) { diff --git a/Packages/com.unity.inputsystem/InputSystem/InputManager.cs b/Packages/com.unity.inputsystem/InputSystem/InputManager.cs index 947bd044a9..f2242eac9a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/InputManager.cs +++ b/Packages/com.unity.inputsystem/InputSystem/InputManager.cs @@ -16,6 +16,9 @@ using UnityEngine.InputSystem.Layouts; using Unity.Profiling; using UnityEngineInternal.Input; +#if UNITY_6000_5_OR_NEWER +using UnityEngine.Assemblies; +#endif #if UNITY_EDITOR using UnityEngine.InputSystem.Editor; @@ -2069,7 +2072,11 @@ internal bool RegisterCustomTypes() var inputSystemAssembly = typeof(InputProcessor).Assembly; var inputSystemName = inputSystemAssembly.GetName().Name; +#if UNITY_6000_5_OR_NEWER + var assemblies = CurrentAssemblies.GetLoadedAssemblies(); +#else var assemblies = AppDomain.CurrentDomain.GetAssemblies(); +#endif foreach (var assembly in assemblies) { try diff --git a/Packages/com.unity.inputsystem/Tests/TestFixture/InputTestFixture.cs b/Packages/com.unity.inputsystem/Tests/TestFixture/InputTestFixture.cs index 834ba09fbb..5364844376 100644 --- a/Packages/com.unity.inputsystem/Tests/TestFixture/InputTestFixture.cs +++ b/Packages/com.unity.inputsystem/Tests/TestFixture/InputTestFixture.cs @@ -12,6 +12,9 @@ using UnityEngine.TestTools; using UnityEngine.TestTools.Utils; using UnityEngine.InputSystem.XR; +#if UNITY_6000_5_OR_NEWER +using UnityEngine.Assemblies; +#endif #if UNITY_EDITOR using UnityEditor; @@ -241,7 +244,11 @@ private bool IsUnityTest() var type = Type.GetType(className); if (type == null) { +#if UNITY_6000_5_OR_NEWER + foreach (var assembly in CurrentAssemblies.GetLoadedAssemblies()) +#else foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) +#endif { type = assembly.GetType(className); if (type != null)