Hello, I need some help with my grid system.
I created a grid system as an 2D-Array of GameObjects. Each of this GameObjects are Slots with a DropHandler Script. I also have a DragHandler Script to put dragged objects into the slot and let them snap into it. This works fine with a single object, which is the same size as the slot.
Now I want to drag different shapes into the grid (like Tetris blocks for example). These blocks are groups of the single object block.
How do I define the border of the grid, so that no object can clip over it? This is the case for the object in the upper right corner of the grid shown in the picture.
I also want to detect which block of each group is in which slot of the grid, but when i take the group out of the grid it should stay as a group like before.
In my current grid which is working with a single object block I added the block to the grid slot like shown in the picture. I don’t know if that is also the right way for group blocks.
The detection of a full slot should not be that difficult, because I can access each slot of the grid from script through the array. But before that I need some help with this. I was testing several ways to do this the last days but with no success.
It should be working in the Canvas, because it is needed in the menu. Hope someone can help me with my problem.