Hide
GetPrefabWithComponent

Automatically assign a prefab to a field, if the field value is null and the prefab has the component. (First one found will be used)

Recommended to use it with FieldType!

  • (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 sign. If null, it'll use the field type.

  • string groupBy = ""

    For error message grouping.

  • Allow Multiple: Yes

using SaintsField; [GetPrefabWithComponent] public Dummy dummy; // get the prefab itself [GetPrefabWithComponent(compType: typeof(Dummy))] public GameObject dummyPrefab; // works so good with `FieldType` [GetPrefabWithComponent(compType: typeof(Dummy)), FieldType(typeof(Dummy))] public GameObject dummyPrefabFieldType;

get_prefab_with_component