Beispiel #1
0
	public void RemoveBlock(BlockData MyBlockData, Vector3 HitPosition, World MyHitWorld) {
		switch (MyBlockData.OnDestroyFunctionId)
		{
		case(1):	// for zone cores
			RemoveZoneBlocks (HitPosition, MyHitWorld);
			break;
		case(2):	// town hall end of game condition?
			GetManager.GetGameManager().EndGame();
			RemoveZoneBlocks (HitPosition, MyHitWorld);
			break;
		case(3):// TNT

			break;
		}
		if (MyBlockData.RemovedSoundEffect)
			SoundSource.PlayOneShot (MyBlockData.RemovedSoundEffect);
		if (GetManager.GetNetworkManager ().IsConnected ())
			MyHitWorld.GetComponent<NetworkView> ().RPC ("SetBlockAir", 
			                                            RPCMode.All,
			                                            Mathf.RoundToInt (HitPosition.x),
			                                            Mathf.RoundToInt (HitPosition.y),
			                                            Mathf.RoundToInt (HitPosition.z)
			);
		else
			MyHitWorld.SetBlockAir (Mathf.RoundToInt (HitPosition.x),
			                       Mathf.RoundToInt (HitPosition.y),
			                       Mathf.RoundToInt (HitPosition.z));
	}