TylerTemp / SaintsField

A Unity Inspector extension tool focusing on script fields inspector enhancement
MIT License
148 stars 9 forks source link

3.1.5 regression? GetComponentInChildren doesn't get component in self. #56

Closed laurentopia closed 1 month ago

laurentopia commented 1 month ago

It used to. And GetComponentInChildren does that. image

laurentopia commented 1 month ago

image

laurentopia commented 1 month ago

and when I set a reference by hand to same-level it complains. image

TylerTemp commented 1 month ago

Hi,

By design GetComponentInChildren does not get component from self, this is different from Unity (so as GetComponentInParent(s))

However I am planing to change this behavior to align with Unity (in the next release) as it is confusing. Also because in previous version we can use GetComponent + GetComponentInChildren, but in last release they can no longer work together... So yeah it indeed needs to be changed.

laurentopia commented 1 month ago

Ok, good to know.

laurentopia commented 1 month ago

which is the latest version supporting getcomponent + getcomponentinchildren?

TylerTemp commented 1 month ago

3.1.3 does 3.1.4 GetComponent* start to support array, which break the GetComponent + GetComponentInChildren

TylerTemp commented 1 month ago

Hi @laurentopia ,

this behavior has been changed in 3.2.0. This version has some breaking changes, please read the change log before upgrading.