Exemplo n.º 1
0
    // CREATE TILES ()
    public void CreateTiles(int num) // Instantiate tiles in the stack..
    {
        for (int i = 0; i < num; i++)
        {
            FloorTiles.Push(Instantiate(tilePrefabs[0]));
            TunnelTiles.Push(Instantiate(tilePrefabs[1]));

            // Using Peek to talk with the last added tile in the stack and set it inactive.. (non-visible)
            FloorTiles.Peek().SetActive(false);
            TunnelTiles.Peek().SetActive(false);
        }
    }