Ejemplo n.º 1
0
    private void Generatelevel()
    {
        foreach (KeyValuePair <Vector3, int> position in TileManager.Instance.TilesPosition)
        {
            int cellColor = GetCellColor(position.Key);

            GameObject newCell     = Instantiate(tilesPrefab[cellColor]) as GameObject;
            Vector3    worldVector = grid.GridToWorldFixed((Vector2)position.Key);
            newCell.transform.position = worldVector;
            newCell.transform.SetParent(this.transform);
        }
    }