mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-10 05:53:55 +08:00
fix destroy logic with lists/dicts
This commit is contained in:
@ -43,7 +43,8 @@ namespace UnityExplorer.Inspectors.Reflection
|
|||||||
|
|
||||||
public void Destroy()
|
public void Destroy()
|
||||||
{
|
{
|
||||||
GameObject.Destroy(this.m_mainContent);
|
if (this.m_mainContent)
|
||||||
|
GameObject.Destroy(this.m_mainContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UpdateValue()
|
public virtual void UpdateValue()
|
||||||
|
@ -65,18 +65,13 @@ namespace UnityExplorer.Inspectors.Reflection
|
|||||||
{
|
{
|
||||||
RefIDictionary = Value as IDictionary;
|
RefIDictionary = Value as IDictionary;
|
||||||
|
|
||||||
if (Value != null)
|
if (m_subContentParent.activeSelf)
|
||||||
{
|
{
|
||||||
if (m_subContentParent.activeSelf)
|
GetCacheEntries();
|
||||||
{
|
RefreshDisplay();
|
||||||
GetCacheEntries();
|
|
||||||
RefreshDisplay();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_recacheWanted = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_entries.Clear();
|
m_recacheWanted = true;
|
||||||
|
|
||||||
base.OnValueUpdated();
|
base.OnValueUpdated();
|
||||||
}
|
}
|
||||||
@ -122,7 +117,7 @@ namespace UnityExplorer.Inspectors.Reflection
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CPP
|
#if CPP
|
||||||
if (RefIDictionary == null && !Value.IsNullOrDestroyed())
|
if (RefIDictionary == null && Value != null)
|
||||||
RefIDictionary = EnumerateWithReflection();
|
RefIDictionary = EnumerateWithReflection();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -49,18 +49,13 @@ namespace UnityExplorer.Inspectors.Reflection
|
|||||||
RefIEnumerable = Value as IEnumerable;
|
RefIEnumerable = Value as IEnumerable;
|
||||||
RefIList = Value as IList;
|
RefIList = Value as IList;
|
||||||
|
|
||||||
if (Value != null)
|
if (m_subContentParent.activeSelf)
|
||||||
{
|
{
|
||||||
if (m_subContentParent.activeSelf)
|
GetCacheEntries();
|
||||||
{
|
RefreshDisplay();
|
||||||
GetCacheEntries();
|
|
||||||
RefreshDisplay();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_recacheWanted = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_entries.Clear();
|
m_recacheWanted = true;
|
||||||
|
|
||||||
base.OnValueUpdated();
|
base.OnValueUpdated();
|
||||||
}
|
}
|
||||||
@ -108,7 +103,7 @@ namespace UnityExplorer.Inspectors.Reflection
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CPP
|
#if CPP
|
||||||
if (RefIEnumerable == null && !Value.IsNullOrDestroyed())
|
if (RefIEnumerable == null && Value != null)
|
||||||
RefIEnumerable = EnumerateWithReflection();
|
RefIEnumerable = EnumerateWithReflection();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user