
Hello, im working with rotate and match hexagon game. Need to idea for multiple selections.
I add every single gameobjects(hexes) in gameobject array like gameobject[,] so i have coordinates of them.
Game should be when you click one hex its need to be clicked 3 hexes like secend image.
This is my solution need to add some controls for -1x and -1y. Its look like noobish. Can i do something diffrent? Thanks.
void findArroundPos(int x, int y){
List<int[,]> arroundPoss = new List<int[,]>();
arroundPoss.Add(new int[x,y]);
arroundPoss.Add(new int[x+1,y]);
arroundPoss.Add(new int[x+1,y-1]);
arroundPoss.Add(new int[x+1,y+1]);
arroundPoss.Add(new int[x-1,y]);
arroundPoss.Add(new int[x-1,y-1]);
arroundPoss.Add(new int[x-1,y+1]);
arroundPoss.Add(new int[x,y+1]);
arroundPoss.Add(new int[x,y-1]);
}