/// <summary> /// Sets up the drawer so that it is ready to be used. /// LateSetup should be called right after this. /// </summary> /// <param name="keyType"> They key type of the elements that can be added to the collection. </param> /// <param name="setMemberInfo"> LinkedMemberInfo for the field or property that these drawers represent. </param> /// <param name="setParent"> Drawer whose member these Drawer are. Can be null. </param> /// <param name="setLabel"> The label (name) of the field. Can be null. </param> /// <param name="setReadOnly"> True if Drawer should be read only. </param> public static CollectionAddFieldDrawer Create([NotNull] Type keyType, [CanBeNull] Func <object[], bool> validateKey, [CanBeNull] Action onAddButtonClicked, [CanBeNull] LinkedMemberInfo memberInfo, [CanBeNull] IParentDrawer parent, [CanBeNull] GUIContent label, bool setReadOnly) { CollectionAddFieldDrawer result; if (!DrawerPool.TryGet(out result)) { result = new CollectionAddFieldDrawer(); } result.Setup(keyType, validateKey, onAddButtonClicked, memberInfo, parent, label, setReadOnly); result.LateSetup(); return(result); }
/// <inheritdoc/> protected override IDrawer BuildResizeField() { return(CollectionAddFieldDrawer.Create(keyType, ValidateNewKey, OnAddButtonClicked, null, this, GUIContentPool.Create("Add"), ReadOnly)); }