We can reuse the Orbit script we wrote for the moon for the earth's orbit around the sun. Of course, where the earth goes, our moon goes too, so we're actually orbiting the earth-moon object:
- Select the Earth-Moon object from Hierarchy.
- Add Component | Scripts | Orbit.
- Drag the Sun object from Hierarchy onto the Around Body slot.
- Set Orbital Period to 365.25 (days in a year).
- Save the scene and the project, then press Play.
Try changing Gametime Per Day of GameController between 24 and 0.05.