How to get identifier in OnClick function?

Hi, I’m making a board game.

In a board, each tiles has its own button. (not a component. board is a one image and there are 36 button gameobjects without image.)

I want to manage their status(activated or not). But I don’t want to put script component to each tiles.

So I tried to use On Click() at Inspector view, which is Button (Script)'s one.

First, I made a ButtonManager class and a boolean array(size is 36, 6x6).

Next, gonna make OnClick() function that will go into OnClick() at the each tile’s Button Inspector and here is the problem.

How to get each button’s identifier or something similar in the OnClick() function?

Do I have to make another script and put it on each tiles?

1 Answer

1

I found an answer!