Hi everyone, can you manipulate two buttons with one for loop? From what it looks like I can only use a for loop once and then you will have to create another for loop for the second button.Otherwise I get an error i does not exist in it’s current context.
[System.Serializable]
public class ButtonValue
{
public int IntValue = 0;
}
public List<ButtonValue> Buttons = new<ButtonValue>(4);
Void OnGUI(){
for (int i = 0; i < Buttons.Count i++)
if(GUILayout.Button("Button1"GUILayout.Width(125), GUILayout.Height(25)){
++Buttons
}
//error i does not exist in it’s current context
if(GUILayout.Button("Button2"GUILayout.Width(125), GUILayout.Height(25)){
++Buttons
}
}