Mislead buttons

Hello,
I want to make quite a few buttons and I would like each of them to change specific object. The problem is when I click on one of them, they are changing all of the objects. Another problem is second button “Edytuj/Edit” doesnt work at all. I thought maybe I should make an array of buttons or something but I cant do it or find any help about it so I guess it is not the way to do this :S Can anyone tell me why my buttons work like this and how to fix it, please?


            while( y < MeczeLista.Count )
			{
				GUI.Label(new Rect(10+(v*10), 50+(20*(y-x)), 10, 20), MeczeLista[y].ID.ToString() );
				GUI.Label(new Rect(30+(v*10), 50+(20*(y-x)), 30, 20), MeczeLista[y].Miejsce );

				GUI.Label(new Rect(60+(v*10), 50+(20*(y-x)), 40, 20), ZawodnicyLista[MeczeLista[y].IDa].Nick );
				WpisanyWynik[(2*y)] = GUI.TextField(new Rect(100+(v*10), 50+(20*(y-x)), 20, 20), MeczeLista[y].A.ToString(), 25);
				int.TryParse(WpisanyWynik[(2*y)], out MeczeLista[y].A);

				WpisanyWynik[(2*y) + 1] = GUI.TextField(new Rect(125+(v*10), 50+(20*(y-x)), 20, 20), MeczeLista[y].B.ToString(), 25);
				int.TryParse(WpisanyWynik[(2*y) + 1], out MeczeLista[y].B);
				GUI.Label(new Rect(150+(v*10), 50+(20*(y-x)), 40, 20), ZawodnicyLista[MeczeLista[y].IDb].Nick );

				if( MeczeLista[y].Zatwierdzony == false )
				{
					if (GUI.Button(new Rect(200+(v*10), 50+(20*(y-x)), 75, 20), "Zatwierdź") ){
						MeczeLista[y].Zatwierdzony = true;
						UaktualnijWyniki();}
				}
				else if( MeczeLista[y].Zatwierdzony == true )
				{
					if (GUI.Button(new Rect(200+(v*10), 50+(20*(y-x)), 75, 20), "Edytuj")){
						MeczeLista[y].Zatwierdzony = false;
						UaktualnijWyniki();}
				}
				y++;
			}

Code might be cofusing so Im posting image of how it looks like. Every row is a data from specific game object. After clicking Zatwierdź which is confirm I want to change value to true so another function knows it can use date from this specific object(match actually) but as mentioned ealier after clicking any of the buttons this value is changed in all objects not only the one next to it.
45496-buttonproblem.png

EDIT: I guess the problem is that when I press the button they “y” change so quickly that it is making all objects to change their value. Might it be the issue? It is not helping the fact Edit button dont work tho ;/

Your problem is line 59:

if( MeczeLista*.Zatwierdzony = true )*

which should be
if( MeczeLista*.Zatwierdzony == true )*
or simply
if( MeczeLista*.Zatwierdzony)*
You set all to true in that line ^^. Usually such mistakes results in an error. The only datatype where no error will be produced is “bool”. That’s because the result of an assignment is the value that got assigned. Since the if statement only accespts bool values this is a valid statement.
// this is also allowed
int a;
int b;
a = b = 42:
It’s evaluated from right to left. like this a = (b = 42). The result of “b = 42” is 42
In an if statement this would produce an error:
if (a = 42)
because 42 is not a bool which is required for the if statement.