GetComponentInChildren/GetInChildrenAutomatically assign a component to a field, if the field value is null and the component is already attached to itself or its child GameObjects. (First one found will be used)
NOTE: Like GetComponentInChildren by Unity, this will check the target object itself.
-
(Optional)
EXP config: config. SeeSaints XPath-like Syntaxsection for more information.Note: You can change the default behavior of these attributes using
Window/Saints/Create or Edit SaintsField Config -
bool includeInactive = falseShould inactive children be included?
trueto include inactive children. -
Type compType = nullThe component type to sign. If null, it'll use the field type.
-
bool excludeSelf = falseWhen
true, skip checking the target itself. -
string groupBy = ""For error message grouping.
-
Allow Multiple: No
GetInChildren by default does NOT check the target object itself, and does INCLUDE inactive objects.
using SaintsField; [GetComponentInChildren] public BoxCollider childBoxCollider; // by setting compType, you can assign it as a different type [GetComponentInChildren(compType: typeof(Dummy))] public BoxCollider childAnotherType; // and GameObject field works too [GetComponentInChildren(compType: typeof(BoxCollider))] public GameObject childBoxColliderGo;
