Exemplo n.º 1
0
            private void UpdateReplacePosition()
            {
                for (int i = 0; i < gridStates.Length; i++)
                {
                    GridState     gridState     = gridStates[i];
                    PieceState    pieceState    = pieceStates[gridState.pieceId];
                    PiecePosition piecePosition = piecePositions[gridState.pieceId];
                    int           x             = i % GridRowLength;

                    if (pieceState.isBanish)
                    {
                        int posY = FieldHeight + (fallCount[x] * GridSize);
                        piecePosition.position = new Vector2Int(piecePosition.position.x, posY);
                        fallCount[x]          += 1;
                    }
                    else
                    {
                        piecePosition.fallLength = fallCount[x] * GridSize;
                        piecePosition.fallCount  = 0;
                    }
                    piecePositions[gridState.pieceId] = piecePosition;
                }
            }