Hide
GetComponent

Automatically assign a component to a field, if the field value is null and the component is already attached to current target. (First one found will be used)

  • (Optional) EXP config: config. See Saints XPath-like Syntax section for more information.

    Note: You can change the default behavior of these attributes using Window/Saints/Create or Edit SaintsField Config

  • Type compType = null

    The component type to assign. If null, it'll use the field type.

  • string groupBy = ""

    For error message grouping.

  • AllowMultiple: No

using SaintsField; [GetComponent] public BoxCollider otherComponent; [GetComponent] public GameObject selfGameObject; // get the GameObject itself [GetComponent] public RectTransform selfRectTransform; // useful for UI [GetComponent] public GetComponentExample selfScript; // yeah you can get your script itself [GetComponent] public Dummy otherScript; // other script

get_component