mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +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();
|
||||
foreach (Component comp in comps)
|
||||
{
|
||||
if (!comp) continue;
|
||||
if (!comp)
|
||||
continue;
|
||||
componentEntries.Add(comp);
|
||||
compInstanceIDs.Add(comp.GetInstanceID());
|
||||
}
|
||||
@ -202,8 +203,23 @@ namespace UnityExplorer.Inspectors
|
||||
behaviourEnabledStates.Clear();
|
||||
foreach (Behaviour behaviour in behaviours)
|
||||
{
|
||||
if (!behaviour) continue;
|
||||
behaviourEntries.Add(behaviour);
|
||||
if (!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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user