GetPrefabWithComponentAutomatically 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. 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 -
Type compType = nullThe 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;
