Yes, but I was thinking there may be an issue there related to capturing a reference type. But, I just tried something equivalent to your code and everything worked fine. Is there more to the code? Because right now it looks like all the buttons are being placed in the same location, which would mean only the top-most(last one) receives click events.
Hmm I don't really see why this shouldn't be working. You could try converting the foreach to a for loop and accessing the Nodes by index in the lambda - note that you might have to copy the index into a local variable. I'd think these two would be equivalent, but maybe something strange is happening with the closure that I do not understand.
Nope, same thing. By the way, local_node is temporary local variable too.
– AkzwarYes, but I was thinking there may be an issue there related to capturing a reference type. But, I just tried something equivalent to your code and everything worked fine. Is there more to the code? Because right now it looks like all the buttons are being placed in the same location, which would mean only the top-most(last one) receives click events.
– jdean300They are placed at ScrollView content with GridLayoutGroup.
– Akzwar[74067-nodes.png|74067]
– AkzwarHmm I don't really see why this shouldn't be working. You could try converting the foreach to a for loop and accessing the Nodes by index in the lambda - note that you might have to copy the index into a local variable. I'd think these two would be equivalent, but maybe something strange is happening with the closure that I do not understand.
– jdean300