mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00
Cleanup
This commit is contained in:
parent
939861b5f0
commit
3639824df3
@ -161,15 +161,13 @@ namespace Explorer
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// check blacklisted members
|
// check blacklisted members
|
||||||
var name = member.DeclaringType.Name + "." + member.Name;
|
var sig = $"{member.DeclaringType.Name}.{member.Name}";
|
||||||
if (_typeAndMemberBlacklist.Any(it => it == name))
|
if (_typeAndMemberBlacklist.Any(it => it == sig))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (_methodStartsWithBlacklist.Any(it => member.Name.StartsWith(it)))
|
if (_methodStartsWithBlacklist.Any(it => member.Name.StartsWith(it)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// compare signature to already cached members
|
|
||||||
var signature = $"{member.DeclaringType.Name}.{member.Name}";
|
|
||||||
if (member is MethodInfo mi)
|
if (member is MethodInfo mi)
|
||||||
{
|
{
|
||||||
AppendParams(mi.GetParameters());
|
AppendParams(mi.GetParameters());
|
||||||
@ -181,15 +179,15 @@ namespace Explorer
|
|||||||
|
|
||||||
void AppendParams(ParameterInfo[] _args)
|
void AppendParams(ParameterInfo[] _args)
|
||||||
{
|
{
|
||||||
signature += " (";
|
sig += " (";
|
||||||
foreach (var param in _args)
|
foreach (var param in _args)
|
||||||
{
|
{
|
||||||
signature += $"{param.ParameterType.Name} {param.Name}, ";
|
sig += $"{param.ParameterType.Name} {param.Name}, ";
|
||||||
}
|
}
|
||||||
signature += ")";
|
sig += ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachedSigs.Contains(signature))
|
if (cachedSigs.Contains(sig))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -201,14 +199,14 @@ namespace Explorer
|
|||||||
var cached = CacheObjectBase.GetCacheObject(member, target);
|
var cached = CacheObjectBase.GetCacheObject(member, target);
|
||||||
if (cached != null)
|
if (cached != null)
|
||||||
{
|
{
|
||||||
cachedSigs.Add(signature);
|
cachedSigs.Add(sig);
|
||||||
list.Add(cached);
|
list.Add(cached);
|
||||||
cached.ReflectionException = exception;
|
cached.ReflectionException = exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
MelonLogger.LogWarning($"Exception caching member {signature}!");
|
MelonLogger.LogWarning($"Exception caching member {sig}!");
|
||||||
MelonLogger.Log(e.ToString());
|
MelonLogger.Log(e.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user