Suppose there is a certain inventory and an element occupying two cells, then how to make it occupy exactly two? There was a choice that each cell should have links to the cells that are near it and make the function of checking the neighboring cells for emptiness. and if all the cells in the desired range are empty, we fill the cell from where the verification went with the necessary element, and the cells in the range we fill in with a link to the root cell element, so that they would not be empty. The logic of the inventory itself is clear, but how to implement it graphically in a unit? stretch the cell to the desired position and cover the next?
- It depends. Already have inventory implementation? Although a sketch? - eastwing
- @eastwing, there is no prka, there is only a part of the graph, and now I am thinking through logic - Andrey
- Well, in general - something like this: each item takes up some cells (MxN). When you throw an object into inventory, you need to determine which cell of the object was the cursor (or finger), which cell of the inventory the cell on which the cursor was located, and check the required number of remaining cells in the right direction from this inventory cell. Graphically, inventory cells do not need to be superimposed on each other - eastwing
- The logic is more or less clear, but how then to make the graphic part? - Andrei
- Well, probably, as usual - with the help of Unity UI - eastwing
|