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
- https://openweathermap.org/city/2158177
- http://answers.unity3d.com/questions/620590/unity-real-life-weather-website-information.html
- https://forum.unity3d.com/threads/current-weather-script.242009/
- https://forum.unity3d.com/threads/using-jsonobject-to-get-data-from-a-weather-api.480882/
- https://www.sitepoint.com/web-apis-and-iot-in-unity/