SaintsField
SaintsField copied to clipboard
GetComponentInParents/Children still shows error box when assigned
I think it's by design but it is not very useful to still show an error when the object was deparented and therefore the references component is no longer in the same hierarchy
Hummmm, so you mean, the MCUnityRelay can be used in different situations, in some case the Unit is in parents, some are not.
And if it's not, and when it's been manually assigned, the error message looks redundant, do I understand correctly?
Well, GetComponentByPath has argument which uses EGetComp.ForceResign | EGetComp.NoResignButton to achive this feature. This is not implemented on other GetComponent* yet.
I think I might do this when I have some spare time
And if it's not, and when it's been manually assigned, the error message looks redundant, do I understand correctly?
that's right. since the attributes are used as a helper, not a nanny, the error message is overreaching.
Hi,
this is now possible in 3.4.0:
[GetComponentInParents] public SpriteRenderer notInParents;
[GetComponentInChildren] public SpriteRenderer notInChildren;
// no button at all
[GetComponentInParents(EXP.Silent | EXP.NoPicker | EXP.NoResignButton)] public SpriteRenderer notInParentsNoButton;
[GetComponentInChildren(EXP.Silent | EXP.NoPicker | EXP.NoResignButton)] public SpriteRenderer notInChildrenNoButton;
The config is kinda tedious. It might be optimized on a later version.
Note: This update might contain bugs.
amazing! thanks I'll live with the complex flags as I think your choice of X when overriden is a perfect default