Posts

Showing posts from March, 2022

Unity Shenanigans - Part 2

Image
Trying new Surfaces I've decided to make new surfaces to render them on Unity. For this, I also developed a way to define and store these locations in the code, which can then load the prefabs that contain these surface models. All these locations are first defined in a class called  Catalogue  as variables, and then initialized. Each of these locations, stored as a  SurfaceLocation  class, holds 4 important data points: Latitude  and Longitude : With this, one can specify where in the planet's surface the location is, as to render the sky (Sun, moons, ...) in the correct placement. Prefab : The string name of the prefab at specific folder inside the Resources  directory. Using this folder instead of adding all prefabs in a script with a lot of Serializable Fields  makes it more user-friendly to add new locations. Celestial Body : To get information on what to render in the sky, color of the atmosphere, ..., the Celestial Body (Planet or moon) where the location is must be spec