UI button issue with variable + inspector
Apologies for the vague title but I can't think of how else to describe the problem. Let's say I have a UI button with a c# script attached to it. It has an onclick function, which basically mines gold and increases the value of a UI text with the total gold amount. The gold value is a field in the script. The weird problem I'm getting is that if I duplicate the UI button, when I run the game clicking the original button works as normal, and the UI text displaying the player's gold increases appropriately. But when I click on the duplicated button the values in the inspector change instead of the UI text. Am I missing something obvious here? Is this a problem because it's two buttons with the same script attached? Any help would be greatly appreciated