I'm working on an interface where the player clicks/taps on a cell in a grid and that cell is labeled with a value of 1 through 5. First click/tap, 1; second click/tap, 2; etc. At any time, the player can deselect any of the highlighted cells. Thus, if 1 through 3 is selected and the player deselects the 2 cell, the 3 cell becomes the new 2.
The purpose of this is because my character will follow the customized path devised by the player - the order of the selected cells will determine that path.
I initially figured using an array and pushing the UID of that selected cell node onto the back of the array. No problem there. Adding the UID values into the array is good.
The problem is IDENTIFYING the correct index in the array that has the UID value of the cell node when DESELECTING it (and thus deleting that array element).
So far, I can't QUITE think of a succinct method to DESELECT cells and thereby update that order of selected cells.
Any suggestions? THANKS!