Skip to content

Commit 7164bb0

Browse files
committed
Introduced the SystemAssemblyIsIncluded bool
1 parent 01b6b72 commit 7164bb0

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Editor/Drawers/TypeDropdownDrawer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
{
33
using System;
44
using System.Collections.Generic;
5+
using System.Linq;
56
using System.Reflection;
67
using TypeDropdown;
8+
using UnityEngine;
79
using Util;
810

911
/// <summary>
@@ -73,13 +75,18 @@ private SortedSet<TypeItem> GetFilteredTypes()
7375
typeRelatedAssemblies,
7476
_attribute);
7577

78+
bool systemAssemblyIsIncluded = typeRelatedAssemblies.Any(assembly => assembly.FullName == "System");
79+
7680
var sortedTypes = new SortedSet<TypeItem>(new TypeItemComparer());
7781

7882
for (int i = 0; i < filteredTypes.Count; i++)
7983
{
8084
var type = filteredTypes[i];
8185
if (type.FullName != null)
86+
{
8287
sortedTypes.Add(new TypeItem(type, _attribute.Grouping));
88+
}
89+
8390
}
8491

8592
return sortedTypes;

Editor/TypeDropdown/TypeItem.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Collections.Generic;
5+
using NUnit.Framework;
56
using Util;
67

78
/// <summary>
@@ -15,8 +16,12 @@ internal readonly struct TypeItem
1516
public readonly string FullTypeName;
1617

1718
public TypeItem(Type type, Grouping grouping)
19+
: this(type, type.FullName ?? string.Empty, grouping) { }
20+
21+
public TypeItem(Type type, string fullTypeName, Grouping grouping)
1822
{
19-
FullTypeName = type.FullName ?? string.Empty;
23+
Assert.IsNotNull(fullTypeName);
24+
FullTypeName = fullTypeName;
2025
Type = type;
2126
Path = TypeNameFormatter.Format(Type, FullTypeName, grouping);
2227
}

0 commit comments

Comments
 (0)