I've been using Unity in about five months now, and I've been working on a project for last few weeks, and it's almost finished. And I want to implement shop UI for my project. And when I attached a button as a child of my shop UI and add a listener to it from a script. it did work. But when I clicked on a parent button the child button is also clicked. So I want my parent button just to change a color for my model as preview, and the child button to buy/set the color if already owned.
So the question is. Is there something wrong with my design or it was my script? or I just can't have a button as a child of another button?
Thanks before, any help would be appreciated.
Here is my code to add a on click listeners
void SetShopButtons()
{
int i = 0;
foreach (Transform t in colorViewport)
{
int currentIndex = i;
Button b1 = t.GetComponent
↧