Beispiel #1
0
	/*public static bool SetBlockAndSave(RaycastHit hit, BlockBase block, bool adjacent) {
		if (hit.collider == null)
			return false;
		
		Chunk chunk = hit.collider.GetComponent<Chunk>();
		if (chunk == null)
			return false;
		
		WorldPos pos = GetBlockPos(hit, adjacent);
		
		chunk.world.SetBlock(pos.x, pos.y, pos.z, block);
		
		// now save whenever i update blocks
		Serialization.SaveChunk(chunk);
		return true;
	}*/

	public static Block GetBlockV(World HitWorld, Vector3 BlockPosition) {
		Block block = HitWorld.GetBlock2(Mathf.RoundToInt(BlockPosition.x),
		                                 Mathf.RoundToInt(BlockPosition.y), 
		                                 Mathf.RoundToInt(BlockPosition.z));
		
		return block;
	}