Use recursive GetGenericArguments to catch unusual type structures, cleanup InteractiveList value caching

This commit is contained in:
Sinai
2021-05-18 20:55:18 +10:00
parent 496a5de55e
commit ac9c2d5286
3 changed files with 32 additions and 15 deletions

View File

@ -75,10 +75,11 @@ namespace UnityExplorer.UI.IValues
else
{
var type = value.GetActualType();
if (type.IsGenericType && type.GetGenericArguments().Length == 2)
{
KeyType = type.GetGenericArguments()[0];
ValueType = type.GetGenericArguments()[1];
if (type.TryGetGenericArguments(out var args) && args.Length == 2)
{
KeyType = args[0];
ValueType = args[1];
}
else
{