Beispiel #1
0
    private void SpawnRandomPieces()
    {
        // Generate a list of pieces as ints
        List <int> activePieces = new List <int>();

        for (int i = 0; i < 3; i++)
        {
            var piece = Random.Range(0, pieces.GetPieces().Count);
            activePieces.Add(piece);
        }
        // Set the gamestate and save it
        gameState.SetAndSaveActivePieces(activePieces);

        //Instantiate pieces
        InstantiatePieces(activePieces);
    }
Beispiel #2
0
 public List <GameObject> GetActivePieces()
 {
     return(pieces.GetPieces(_activePieces));
 }