Unity’s IMGUI is a really strange beast, and you seem to have a basic misunderstanding of how it works. This is a method that basically gets called over and over and over, and each control you want to appear needs to be called every time. However, GUI.Button only returns true once, when clicked. So you need to display the text fields outside the if statement, and inside the if statement is just where you “remember” to show it.
From what I can see, it seems like you want the plus button to add a new text box with the contents set to “field” each time it’s clicked, so here’s my attempt at that:
private static List<string> s = new List<string>();
private void OnGUI()
{
if (GUILayout.Button("+"))
{
s.Add("field");
}
for (int i = 0; i < s.Count; i++) {
s[i] = GUILayout.TextField(s[i]);
}
}
(From memory; pardon any compiler errors)
Note how I also used GUILayout instead of just GUI so I don’t need to specify the rect of each control.