Skip to content
Snippets Groups Projects
Commit 255b4144 authored by Robin Ruud Kristensen's avatar Robin Ruud Kristensen
Browse files

fix for chest error when picking item

parent cb6ca43a
No related branches found
No related tags found
1 merge request!79Ruud1
......@@ -28,7 +28,8 @@ namespace BigSock.UI {
// Gets button gameobjects and adds onClick listener
for (int i = 0; i < 3; i++) {
var button = itemButtonLocation.transform.Find("ButtonItem"+(i+1).ToString()).GetComponent<Button>();
button.onClick.AddListener(delegate {ItemPicked(i); });
int j = i;
button.onClick.AddListener(delegate {ItemPicked(j); });
buttons.Add(button);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment