mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00
Fix weird Behaviour inheritance issue
This commit is contained in:
parent
70d67f1dad
commit
5a3cad9be2
@ -193,7 +193,8 @@ namespace UnityExplorer.Inspectors
|
|||||||
compInstanceIDs.Clear();
|
compInstanceIDs.Clear();
|
||||||
foreach (Component comp in comps)
|
foreach (Component comp in comps)
|
||||||
{
|
{
|
||||||
if (!comp) continue;
|
if (!comp)
|
||||||
|
continue;
|
||||||
componentEntries.Add(comp);
|
componentEntries.Add(comp);
|
||||||
compInstanceIDs.Add(comp.GetInstanceID());
|
compInstanceIDs.Add(comp.GetInstanceID());
|
||||||
}
|
}
|
||||||
@ -202,8 +203,23 @@ namespace UnityExplorer.Inspectors
|
|||||||
behaviourEnabledStates.Clear();
|
behaviourEnabledStates.Clear();
|
||||||
foreach (Behaviour behaviour in behaviours)
|
foreach (Behaviour behaviour in behaviours)
|
||||||
{
|
{
|
||||||
if (!behaviour) continue;
|
if (!behaviour)
|
||||||
behaviourEntries.Add(behaviour);
|
continue;
|
||||||
|
|
||||||
|
// Don't ask me how, but in some games this can be true for certain components.
|
||||||
|
// They get picked up from GetComponents<Behaviour>, but they are not actually Behaviour...?
|
||||||
|
if (!typeof(Behaviour).IsAssignableFrom(behaviour.GetType()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
behaviourEntries.Add(behaviour);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ExplorerCore.LogWarning(ex);
|
||||||
|
}
|
||||||
|
|
||||||
behaviourEnabledStates.Add(behaviour.enabled);
|
behaviourEnabledStates.Add(behaviour.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user