Unity mobile
Testing Unity on mobile, exported to Android.
​
Incorporates Singletons, Encapsulation, Inheritance, Polymorphism, Single Responsibility Principles, and Interfaces.
​
Integrates 3rd party services.
Within the level are assets for both day time and night time. A real time daylight value is being derived by retrieving the sunrise and sunset values from openweathermap.org. A float for the current day light value is being derived by normalizing the current time between these two values.
​
To prevent the daylight float being set once the sun has gone down, the function only works if the current time is between sunrise and sunset.
![sun1.jpg](https://static.wixstatic.com/media/5b7f2a_90611c57baf84d939a08e8db8269f51e~mv2.jpg/v1/fill/w_600,h_206,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/sun1.jpg)
This value is then synced to the opacity scale of the "day time" assets, ascending until midday, descending until sunset.
![sun4.jpg](https://static.wixstatic.com/media/5b7f2a_f5d717d9398140d78d4931a3727c4e98~mv2.jpg/v1/crop/x_0,y_4,w_1345,h_472/fill/w_600,h_211,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/sun4.jpg)
![day.jpg](https://static.wixstatic.com/media/5b7f2a_58221a6e6e3440ec82dfa63181e039ca~mv2.jpg/v1/fill/w_589,h_235,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/day.jpg)
![night.jpg](https://static.wixstatic.com/media/5b7f2a_cd0f4443b5a543dbbcdf588bb84edb26~mv2.jpg/v1/fill/w_598,h_234,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/night.jpg)