Cleanup, extend ParseUtility to dict keys

This commit is contained in:
Sinai
2021-05-09 02:22:03 +10:00
parent c04a864b74
commit 7b700cbe55
19 changed files with 44 additions and 36 deletions

View File

@ -77,8 +77,12 @@ namespace UnityExplorer.UI.Inspectors
Inspectors.Add(inspector);
inspector.Target = target;
if (sourceCache != null && inspector is ReflectionInspector ri)
ri.ParentCacheObject = sourceCache;
if (sourceCache != null && sourceCache.CanWrite)
{
// only set parent cache object if we are inspecting a struct, otherwise there is no point.
if (target.GetType().IsValueType && inspector is ReflectionInspector ri)
ri.ParentCacheObject = sourceCache;
}
UIManager.SetPanelActive(UIManager.Panels.Inspector, true);
inspector.UIRoot.transform.SetParent(InspectorPanel.Instance.ContentHolder.transform, false);