How to create a textfield in custom window editor using a button?


I have a button on my custom editor and wanted to add a text field just on top of button on button click.
For Eg:

i currently have this:-


If the button is pressed, i want this:-


every time the button is pressed, one more input below input 1 should come.

How can I do that?

I guess you want to store the values in some kind of list then? Just draw a text field for each list entry and make the button add a list entry.

private List&ltstring&gt list;
for (int i = 0; i < list.Count; i++) {
    list _= GUILayout.TextField(list*);*_
_*if (GUILayout.Button("+")) {*_