Exemplo n.º 1
0
    private void SpawnPieces()
    {
        if (isSymmetric)
        {
            foreach (Piece item in Pieces._instance.piecesRemaining)
            {
                newOrderedPieces.Add(FabricatePiece(item, p1PieceParent.transform, 0).transform);
                currentXOffset++;
            }
        }

        else if (playerCount == 2)
        {
            foreach (Piece item in Pieces._instance.piecesRemaining)
            {
                newOrderedPieces.Add(FabricatePiece(item, p1PieceParent.transform, 1).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p2Pieces = Pieces.GetRandomizedList();

            Debug.Log(p2Pieces);

            foreach (Piece item in p2Pieces)
            {
                newOrderedPieces2.Add(FabricatePiece(item, p2PieceParent.transform, 2).transform);
                currentXOffset++;
            }
        }
        else if (playerCount == 3)
        {
            foreach (Piece item in Pieces._instance.piecesRemaining)
            {
                newOrderedPieces.Add(FabricatePiece(item, p1PieceParent.transform, 1).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p2Pieces = Pieces.GetRandomizedList();
            foreach (Piece item in p2Pieces)
            {
                newOrderedPieces2.Add(FabricatePiece(item, p2PieceParent.transform, 2).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p3Pieces = Pieces.GetRandomizedList();
            foreach (Piece item in p3Pieces)
            {
                newOrderedPieces3.Add(FabricatePiece(item, p3PieceParent.transform, 3).transform);
                currentXOffset++;
            }
        }
        else if (playerCount == 4)
        {
            foreach (Piece item in Pieces._instance.piecesRemaining)
            {
                newOrderedPieces.Add(FabricatePiece(item, p1PieceParent.transform, 1).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p2Pieces = Pieces.GetRandomizedList();
            foreach (Piece item in p2Pieces)
            {
                newOrderedPieces2.Add(FabricatePiece(item, p2PieceParent.transform, 2).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p3Pieces = Pieces.GetRandomizedList();
            foreach (Piece item in p3Pieces)
            {
                newOrderedPieces3.Add(FabricatePiece(item, p3PieceParent.transform, 3).transform);
                currentXOffset++;
            }

            currentXOffset = 0;
            List <Piece> p4Pieces = Pieces.GetRandomizedList();
            foreach (Piece item in p4Pieces)
            {
                newOrderedPieces4.Add(FabricatePiece(item, p4PieceParent.transform, 4).transform);
                currentXOffset++;
            }
        }
    }