Tag Archives: unity

WWW – Simple access to web pages

I’m building an interactive experience which makes use of available weather data, much like the data services made available by the BOM or the OpenWeatherMap. This means I need to be able to load data from the web, parse it and then transform 3D geometry based on real world locations and the loaded weather data.

That’s a whole load of stuff to figure out and then pull together, so I’m making a start by learning how to load data by retrieving the contents of URLs and weather specific data, just to get the whole thing going.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using System.Xml;
//using System;

public class SimpleWebAccess : MonoBehaviour {

	IEnumerator Start()

	{
	
		WWW www = new WWW ("ftp://ftp.bom.gov.au/anon/gen/fwo/IDV10751.xml");
		yield return www;
		print (www.text);

		}
}

Related links