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 AssetIdRemapUtility/Editor/PackageImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using System.Text;
using UnityEditor;
using UnityEngine;
#if UNITY_6000_5_OR_NEWER
using UnityEngine.Assemblies;
#endif

namespace UnityEngine.ProBuilder.AssetIdRemapUtility
{
Expand Down Expand Up @@ -133,7 +136,11 @@

internal static bool IsProBuilder4OrGreaterLoaded()
{
#if UNITY_6000_5_OR_NEWER
return CurrentAssemblies.GetLoadedAssemblies().Any(x => x.ToString().Contains("Unity.ProBuilder"));

Check warning on line 140 in AssetIdRemapUtility/Editor/PackageImporter.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

AssetIdRemapUtility/Editor/PackageImporter.cs#L140

Added line #L140 was not covered by tests
#else
return AppDomain.CurrentDomain.GetAssemblies().Any(x => x.ToString().Contains("Unity.ProBuilder"));
#endif
}
}
}
7 changes: 7 additions & 0 deletions Editor/EditorCore/EditorToolbarLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using UnityEngine.ProBuilder;
using System.Linq;
using System.Reflection;
#if UNITY_6000_5_OR_NEWER
using UnityEngine.Assemblies;
#endif

namespace UnityEditor.ProBuilder
{
Expand Down Expand Up @@ -132,7 +135,11 @@ internal static List<MenuAction> GetActions(bool forceReload = false)

static void SearchForMenuAttributes(List<MenuAction> list)
{
#if UNITY_6000_5_OR_NEWER
foreach (var assembly in CurrentAssemblies.GetLoadedAssemblies())
#else
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
#endif
{
try
{
Expand Down
7 changes: 7 additions & 0 deletions Editor/EditorCore/ReflectionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using System.Reflection;
using System.Collections.Generic;
using UnityEngine.ProBuilder;
#if UNITY_6000_5_OR_NEWER
using UnityEngine.Assemblies;
#endif

namespace UnityEditor.ProBuilder
{
Expand Down Expand Up @@ -37,7 +40,11 @@

if (t == null)
{
#if UNITY_6000_5_OR_NEWER
IEnumerable<Assembly> assemblies = CurrentAssemblies.GetLoadedAssemblies();

Check warning on line 44 in Editor/EditorCore/ReflectionUtility.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Editor/EditorCore/ReflectionUtility.cs#L44

Added line #L44 was not covered by tests
#else
IEnumerable<Assembly> assemblies = AppDomain.CurrentDomain.GetAssemblies();
#endif

if (assembly != null)
assemblies = assemblies.Where(x => x.FullName.Contains(assembly));
Expand Down