More progress, cleanups and fixes

This commit is contained in:
Sinai
2021-05-04 20:10:46 +10:00
parent 302ff29e36
commit a89d66cf81
30 changed files with 807 additions and 176 deletions

View File

@ -20,16 +20,20 @@ namespace UnityExplorer.UI.Inspectors.CacheObject
base.SetInspectorOwner(inspector, member);
}
protected override void TryEvaluate()
protected override object TryEvaluate()
{
try
{
Value = FieldInfo.GetValue(this.Owner.Target.TryCast(this.DeclaringType));
var ret = FieldInfo.GetValue(this.Owner.Target.TryCast(this.DeclaringType));
HadException = false;
LastException = null;
return ret;
}
catch (Exception ex)
{
HadException = true;
LastException = ex;
return null;
}
}
@ -37,7 +41,7 @@ namespace UnityExplorer.UI.Inspectors.CacheObject
{
try
{
FieldInfo.SetValue(FieldInfo.IsStatic ? null : Owner.Target, value);
FieldInfo.SetValue(FieldInfo.IsStatic ? null : Owner.Target.TryCast(this.DeclaringType), value);
}
catch (Exception ex)
{