Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Assets/Tests/InputSystem/CoreTests_Controls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -1545,7 +1548,11 @@ public void Controls_PrecompiledLayouts_AllChildControlPropertiesHaveSetters()
var inputDevice = typeof(InputDevice);
var inputControlType = typeof(InputControl);
var checkedTypes = new HashSet<Type>();
#if UNITY_6000_5_OR_NEWER
foreach (var assembly in CurrentAssemblies.GetLoadedAssemblies())
#else
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
#endif
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -40,7 +43,11 @@
var currentAssemblyName = typeof(UnityEngine.InputSystem.InputSystem).Assembly.GetName().Name;

var typesByAssemblies = new Dictionary<System.Reflection.Assembly, Type[]>();
#if UNITY_6000_5_OR_NEWER
var assemblies = CurrentAssemblies.GetLoadedAssemblies();

Check warning on line 47 in Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/BuildPipeline/LinkFileGenerator.cs#L47

Added line #L47 was not covered by tests
#else
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
#endif
foreach (var assembly in assemblies)
{
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down Expand Up @@ -50,7 +53,11 @@ internal static Type LookupEditorForType(Type type)
if (s_TypeLookupCache == null)
{
s_TypeLookupCache = new Dictionary<Type, Type>();
#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)
{
Expand Down
7 changes: 7 additions & 0 deletions Packages/com.unity.inputsystem/InputSystem/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down