diff --git a/src/Core/Reflection/ReflectionUtility.cs b/src/Core/Reflection/ReflectionUtility.cs
index d5dc8a5..61a4dd3 100644
--- a/src/Core/Reflection/ReflectionUtility.cs
+++ b/src/Core/Reflection/ReflectionUtility.cs
@@ -45,6 +45,9 @@ namespace UnityExplorer
/// Key: Type.FullName
public static readonly SortedDictionary AllTypes = new SortedDictionary(StringComparer.OrdinalIgnoreCase);
+ public static readonly List AllNamespaces = new List();
+ private static readonly HashSet uniqueNamespaces = new HashSet();
+
private static string[] allTypesArray;
public static string[] GetTypeNameArray()
{
@@ -81,6 +84,19 @@ namespace UnityExplorer
{
foreach (var type in asm.TryGetTypes())
{
+ if (!string.IsNullOrEmpty(type.Namespace) && !uniqueNamespaces.Contains(type.Namespace))
+ {
+ uniqueNamespaces.Add(type.Namespace);
+ int i = 0;
+ while (i < AllNamespaces.Count)
+ {
+ if (type.Namespace.CompareTo(AllNamespaces[i]) < 0)
+ break;
+ i++;
+ }
+ AllNamespaces.Insert(i, type.Namespace);
+ }
+
if (AllTypes.ContainsKey(type.FullName))
AllTypes[type.FullName] = type;
else
diff --git a/src/Core/Tests/TestClass.cs b/src/Core/Tests/TestClass.cs
index f36807e..c65948e 100644
--- a/src/Core/Tests/TestClass.cs
+++ b/src/Core/Tests/TestClass.cs
@@ -14,54 +14,6 @@ using UnhollowerBaseLib;
namespace UnityExplorer.Tests
{
- public struct TestValueStruct
- {
- public const object TestIgnoreThis = null;
- public const string TestIgnoreButValid = "";
-
- public string aString;
- public int anInt;
- public float aFloat;
- public bool aBool;
- public Vector3 AVector3;
- public Vector4 aVector4;
- public DateTime aDateTime;
- public Color32 aColor32;
- public CameraClearFlags clearFlags;
- }
-
- public enum TestEnum : long
- {
- Neg50 = -50,
- Neg1 = -1,
- Zero = 0,
- One = 1,
- Pos49 = 49,
- Implicit50,
- Also50 = 50,
- AlsoAlso50 = 50,
- };
- public enum TestEnum2 : ulong
- {
- Min = ulong.MinValue,
- Max = ulong.MaxValue
- }
- [Flags]
- public enum TestFlags : int
- {
- All = -1,
- Zero = 0,
- Ok = 1,
- Two = 2,
- Three = 4,
- Four = 8,
- Five = 16,
- Six = 32,
- Seven = 64,
- Thirteen = Six | Seven,
- Fifteen = Four | Five | Six,
- }
-
public static class TestClass
{
public static void ATestMethod(string s, float f, Vector3 vector, DateTime date, Quaternion quater, bool b, CameraClearFlags enumvalue)
@@ -69,17 +21,6 @@ namespace UnityExplorer.Tests
ExplorerCore.Log($"{s}, {f}, {vector.ToString()}, {date}, {quater.eulerAngles.ToString()}, {b}, {enumvalue}");
}
- public static TestValueStruct AATestStruct;
-
- public static string AAATooLongString = new string('#', UIManager.MAX_INPUTFIELD_CHARS + 2);
- public static string AAAMaxString = new string('@', UIManager.MAX_INPUTFIELD_CHARS);
-
- public static TestEnum AATestEnumOne = TestEnum.Neg50;
- public static TestEnum2 AATestEnumTwo = TestEnum2.Max;
- public static TestFlags AATestFlags = TestFlags.Thirteen;
- public static BindingFlags AATestbinding;
- public static HideFlags AAHideFlags;
-
public static List AWritableList = new List { 1, 2, 3, 4, 5 };
public static Dictionary AWritableDict = new Dictionary { { "one", 1 }, { "two", 2 } };
@@ -121,7 +62,7 @@ namespace UnityExplorer.Tests
}
};
- public static IDictionary DictTest = new Dictionary