当前位置: 首页>>代码示例>>C#>>正文


C# Tile.Change方法代码示例

本文整理汇总了C#中Tile.Change方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.Change方法的具体用法?C# Tile.Change怎么用?C# Tile.Change使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tile的用法示例。


在下文中一共展示了Tile.Change方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Turn

	public void Turn () 
	{
		if (Random.Range(0, 10) == 0)
			Kill();
		manager.cascade.UpdateSize();
		// Check the four adjacent tiles to make sure that they exist.

		// Disqualify mountains and crags
		// Also disqualify if last tile occupied

		int coordX = currentTile.x;
		int coordY = currentTile.y;

		List<Tile> candidates = new List<Tile>();

		// Four checks
		Tile currentCheck;

		if (coordY != 0) {
			currentCheck = manager.getTile[coordX, coordY-1];
			if (currentCheck.type != (int)TileType.tile.MOUNTAIN && (previousTile == null || currentCheck != previousTile))
				candidates.Add(currentCheck);
		}

		if (coordX != 0) {
			currentCheck = manager.getTile[coordX-1, coordY];
			if (currentCheck.type != (int)TileType.tile.MOUNTAIN && (previousTile == null || currentCheck != previousTile))
				candidates.Add(currentCheck);
		}

		if (coordX != manager.cascade.width-1) { 
			currentCheck = manager.getTile[coordX+1, coordY];
			if (currentCheck.type != (int)TileType.tile.MOUNTAIN && (previousTile == null || currentCheck != previousTile))
				candidates.Add(currentCheck);
		}

		if (coordY != manager.cascade.height-1) { 
			currentCheck = manager.getTile[coordX, coordY+1];
			if (currentCheck.type != (int)TileType.tile.MOUNTAIN && (previousTile == null || currentCheck != previousTile))
				candidates.Add(currentCheck);
		}

		previousTile = currentTile;
		if (candidates.Count == 0) {
			Kill();
			return;
		}

		currentTile = candidates[Random.Range(0, candidates.Count)];

		// Apply air effects here.
		currentTile.Change((int)TileType.element.AIR);
		manager.Change(manager.objectFromTile[currentTile],currentTile);
		Debug.Log(currentTile.x + "," + currentTile.y);

		transform.position = new Vector3 (
			manager.objectFromTile[currentTile].transform.position.x,
			manager.objectFromTile[currentTile].transform.position.y+manager.worldScale.y, 
			manager.objectFromTile[currentTile].transform.position.z);
	}
开发者ID:jmerzian,项目名称:CultivatingEntropy,代码行数:60,代码来源:Storm.cs

示例2: StartFire

	public void StartFire(Tile newTile)
	{
		tile = newTile;
		tile.fire = true;
		burnout = tile.burnout;
		MeshFilter filter = gameObject.AddComponent<MeshFilter> ();
		MeshRenderer renderer = gameObject.AddComponent<MeshRenderer>();
		
		filter.mesh = Resource.fireMesh;
		renderer.material = Resource.fireMaterial;

		Vector3 FirePosition = 
		transform.position = new Vector3 (
				manager.objectFromTile[tile].transform.position.x,
				manager.objectFromTile[tile].transform.position.y+manager.worldScale.y, 
				manager.objectFromTile[tile].transform.position.z);

		newTile.Change ((int)TileType.element.FIRE);
		manager.Change (manager.objectFromTile [tile], tile);
	}
开发者ID:jmerzian,项目名称:CultivatingEntropy,代码行数:20,代码来源:Fire.cs


注:本文中的Tile.Change方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。