Im following BergZerg Arcade tutorial and before then I keep coming across this ++ thing, what is it? I think its someone to do with adding, but adding what?
I suspect its adding something to the variable x
(Same case with y)
public bool Dragable = true;
public Rect InvWindowRect = new Rect (10, 10, 170, 265);
public int InvRows = 7;
public int InvColumns = 4;
public int ButtonWidth = 40;
public int ButtonHeight = 40;
public void InventoryWindow(int id)
{
for (int x = 0; x < InvRows; x++)
{
for(int y = 0; y < InvColumns; y++)
{
GUI.Button(new Rect(5 + (x * ButtonWidth), 20 + (y * ButtonHeight), ButtonWidth, ButtonHeight), (x + y * InvColumns).ToString());
}
}
if (Dragable)
{
GUI.DragWindow(/*new Rect(10, 2, 0, 0)*/);
}
Update:
Ok I looked into it more, does it mean that each time that line is executed, it adds 1 to the value of x?
So for the first time if x = 0 and x++ is executed it will add 1 and its passed a second time and adds another 1 to the value so it would be 2 and so on.
Is this correct?