Example #1
0
	public void AddTile(Tile target)
	{
		Color color = CurrentTile.GetComponent<Renderer>().material.color;
		target.updateColor(color);
		
		transform.gameObject.GetComponent<MergeVillages>().CheckForMerge();
	}
Example #2
0
	// Checks to make sure tile t is of a different color as home tile's color, then adds that tile to the list of tiles in the village
	public void DestroyVill(Tile t)
	{
		Color homeColor = Home.transform.GetComponentInParent<Renderer>().material.color;
		Color tileColor = t.transform.GetComponentInParent<Renderer>().material.color;
		
		// If the Home tile colour is not the same as the destination, change the colour of the destionation tile
		if (homeColor != tileColor)
		{
			Home.AddTile(t);
			if (tileColor != Color.gray)
			{
				Debug.Log("Splitting at tile: " + t.Position);
				GetComponent<SplitVillages>().CheckForSplit(tileColor, t);
			}
			
			t.updateColor(Color.gray);
		}
	}