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