Exemplo n.º 1
0
    public Tile DrawTile(Map map)
    {
        TilePrefabCollection TPC = GameObject.Find("TilePrefabCollection").GetComponent <TilePrefabCollection>();
        Tile tile = null;

        if (Topology == TileTopology.Ocean || Topology == TileTopology.Lake || Topology == TileTopology.DeepOcean)
        {
            tile = GameObject.Instantiate(TPC.BasicTile_Water, map.transform);
        }
        else if (Topology == TileTopology.Plains)
        {
            tile = GameObject.Instantiate(TPC.BasicTile_Plains, map.transform);
        }
        else if (Topology == TileTopology.Hills)
        {
            tile = GameObject.Instantiate(TPC.BasicTile_Hills, map.transform);
        }
        else if (Topology == TileTopology.Mountains)
        {
            tile = GameObject.Instantiate(TPC.BasicTile_Mountains, map.transform);
        }

        tile.FogOfWarObject = GameObject.Instantiate(TPC.FogOfWar, map.transform);

        tile.Initialize(this, map);
        return(tile);
    }
Exemplo n.º 2
0
    private Color GetSimpleTileColor()
    {
        TilePrefabCollection TPC = GameObject.Find("TilePrefabCollection").GetComponent <TilePrefabCollection>();

        if (Type == TileType.Water)
        {
            if (Topology == TileTopology.Ocean)
            {
                return(TPC.OceanColor);
            }
            else if (Topology == TileTopology.DeepOcean)
            {
                return(TPC.DeepOceanColor);
            }
            else if (Topology == TileTopology.Lake)
            {
                return(TPC.LakeColor);
            }
        }
        else
        {
            if (Biome == TileBiome.Desert)
            {
                return(TPC.DesertColor);
            }
            else if (Biome == TileBiome.Grassland)
            {
                return(TPC.GrasslandColor);
            }
            else if (Biome == TileBiome.Savanna)
            {
                return(TPC.SavannaColor);
            }
            else if (Biome == TileBiome.Shrubland)
            {
                return(TPC.ShrublandColor);
            }
            else if (Biome == TileBiome.Taiga)
            {
                return(TPC.TaigaColor);
            }
            else if (Biome == TileBiome.Temperate)
            {
                return(TPC.TemperateColor);
            }
            else if (Biome == TileBiome.TemperateRainForest)
            {
                return(TPC.TemperateRainforestColor);
            }
            else if (Biome == TileBiome.Tropical)
            {
                return(TPC.TropicalColor);
            }
            else if (Biome == TileBiome.TropicalRainForest)
            {
                return(TPC.TropicalRainforestColor);
            }
            else if (Biome == TileBiome.Tundra)
            {
                return(TPC.TundraColor);
            }
            else if (Biome == TileBiome.Ice)
            {
                return(TPC.IceColor);
            }
        }
        return(Color.black);
    }