Exemplo n.º 1
0
    public void changeTileFeature(float x, float y, BiomeFeatures feature)
    {
        Tile tile = this.pixelToHex(x, y);

        if (tile != null)
        {
            tile.changeBiomeFeature(feature);
        }
    }
Exemplo n.º 2
0
 public void changeBiomeFeature(BiomeFeatures nFeature)
 {
     if (nFeature == BiomeFeatures.None || biome == Biome.Ocean)
     {
     }
     else
     {
         this.feature = nFeature;
         graphics.buildFeatures(position, phantomPosition, nFeature, tileNum);
     }
 }
Exemplo n.º 3
0
	public void setOnClickActionRiver(){


		biomeSelected = Biome.None;
		biomeFeatureSelected = BiomeFeatures.None;
		if(biomeTransistionSelected == BiomeTransistion.None){
			biomeTransistionSelected = BiomeTransistion.River;
		}
		else{
			biomeTransistionSelected = BiomeTransistion.None;
		}

	}
Exemplo n.º 4
0
    public Tile(int q, int r, int s, float xPos, float yPos, int i, int j, int tileNo, BoardGraphics nGraphics, bool inWestHalf, float mapX)
    {
        position = new Vector3(xPos, yPos, 0);

        if (inWestHalf)
        {
            phantomPosition = new Vector3(xPos + mapX, yPos, 0);
        }
        else
        {
            phantomPosition = new Vector3(xPos - mapX, yPos, 0);
        }


        graphics = nGraphics;
        qCoord   = q;
        rCoord   = r;
        sCoord   = s;

        if (q + r + s != 0)
        {
            Debug.Log("False");
        }

        iCoord = i;
        jCoord = j;

        tileNum = tileNo;

        vertexList = new Vertex[6];
        edgeList   = new Edge[6];

        biome   = Biome.Ocean;
        feature = BiomeFeatures.None;

        graphics.buildTile(position, phantomPosition, Biome.Ocean, tileNum);

        province = null;
    }
Exemplo n.º 5
0
	public void setOnClickActionTerrain(BiomeFeatures feature){

		biomeSelected = Biome.None;
		biomeTransistionSelected = BiomeTransistion.None;
		biomeFeatureSelected = feature;
	}
Exemplo n.º 6
0
	public void setOnClickAction(Biome biome){
		biomeSelected = biome;
		biomeTransistionSelected = BiomeTransistion.None;
		biomeFeatureSelected = BiomeFeatures.None;
	}
Exemplo n.º 7
0
    public void buildFeatures(Vector3 position, Vector3 secondPosition, BiomeFeatures nFeature, int tileNo)
    {
        GameObject newTilePiece = forestPiece;

        if (nFeature == BiomeFeatures.Clear || nFeature == BiomeFeatures.None)
        {
            if (featurePieces[tileNo] != null)
            {
                Destroy(featurePieces[tileNo]);
            }
        }
        else
        {
            switch (nFeature)
            {
            case BiomeFeatures.Forest:
                newTilePiece = forestPiece;
                break;

            case BiomeFeatures.Hill:
                newTilePiece = hillPiece;
                break;

            case BiomeFeatures.Mountain:
                newTilePiece = mountainPiece;
                break;

            case BiomeFeatures.Swamp:
                newTilePiece = swampPiece;
                break;
            }

            if (featurePieces[tileNo] == null)
            {
                GameObject test = GameObject.Instantiate(newTilePiece, position, Quaternion.identity) as GameObject;
                test.transform.parent = gameObject.transform;
                featurePieces[tileNo] = test;
                test.isStatic         = true;

                GameObject test1 = GameObject.Instantiate(newTilePiece, secondPosition, Quaternion.identity) as GameObject;
                test1.transform.parent = gameObject.transform;
                featurePieces[tileNo + (tilePieces.Length / 2)] = test1;
                test1.isStatic = true;
            }
            else
            {
                Destroy(featurePieces[tileNo]);
                Destroy(featurePieces[tileNo + (tilePieces.Length / 2)]);

                GameObject test = GameObject.Instantiate(newTilePiece, position, Quaternion.identity) as GameObject;
                test.transform.parent = gameObject.transform;
                featurePieces[tileNo] = test;
                test.isStatic         = true;

                GameObject test1 = GameObject.Instantiate(newTilePiece, secondPosition, Quaternion.identity) as GameObject;
                test1.transform.parent = gameObject.transform;
                featurePieces[tileNo + (tilePieces.Length / 2)] = test1;
                test1.isStatic = true;
                //Color color = new Color(1,0,0);
                //test.GetComponent<SpriteRenderer>().color = color;
            }
        }
    }