2020-52: Weather background and bubbles
Victoria: Changing background to reflect the weather
This week, I implemented the weather appearances into the Unity project. For a simpler system, I grouped a couple of the weather conditions together. I classified “Thunderstorm”, “Drizzle” and “Rain” to be “Rain”. “Clouds” and “Snow” remain the same and anything else (i.e. “Clear” and anything under the Atmosphere group) was classfied as “Clear”. So the background can only change between 4 states: “Clear”, “Clouds”, “Rain” and “Snow”. For “Clear”, I simply used the default skybox to represent it. For the other 3 weather states, I used a free asset, AllSky, which gave me a skybox to use for clouds. I then created ParticleSystems to represent raindrops and snow. I simply altered the colour and shapes slightly to achieve the effect. Here is a video which shows the system cycling through the various weather states with 5 second intervals:
I also modified the code so it calls the API every 10 minutes (value can be modified).
Kaloyan: Add animations for the bubbles
For the bubbles to appear and disappear more smooth I had to add some animations. Usind the ones Tingmao made for the video player as an example, I created a Animator object to control them:
And this is what it looked like in the end: