I have a list of Game Objects ID, for example, {ID1, ID2, ID3, ID3, ID3, ID2, ID2, ID1, ID2, ID2, ID4}
I need to keep looping through the list and merge Game Objects with similar ID, like this:
First itiration: {ID(1+1), ID2, ID(2+2), ID(2+2), ID3, ID(3+3), ID4} => {ID2, ID2, ID4, ID4, ID3, ID6, ID4}
Second itiration: {ID(2+2), ID(4+4), ID3, ID6, ID4} => {ID4, ID8, ID3, ID6, ID4}
Third itiration: {ID(4+4), ID8, , ID6, ID3} => {ID8, ID8, ID6, ID3}
Fourth itiration: {ID(8+8), ID6, ID3} => {ID16, ID6, ID3}
I have been stuck in this for several hours without any clue! any help is really appreciated!