top of page

Day & Night System

  • Writer: Lewis Bailey
    Lewis Bailey
  • Feb 12, 2024
  • 2 min read

Required Packages


How To Use


Main Scripts


Time Manager


Date Settings:

Date in Month

  • This controls what day you are current in. Given the current season.

  • If you set it to 18, season to 2 and year to 3, the date would be 18th Summer 3

Season

This controls what season you are currently in.

  1. Spring

  2. Summer

  3. Autumn

  4. Winter

Year

  • This controls what year of the game you are currently in.

Hours

  • Current hour in the day.

Minutes

  • Current minute of the hour

Seconds

  • Current second of the minute.


Tick Settings

Advance Time Increment (ATI)

  • This is how fast the day goes by. Default for this is 4.24 which means each day would last about 17 minutes. But this can be changed if you want so the can can be longer or shorter.


Events

You could for instance create a event that is called when the season changes you could add an Event into the TimeManager Script under the [Header("Events")] that's called OnSeasonChanged that takes in a int which you can then invoke in AdvanceSeason(). This could also be done for all of the different functions in Time Advancement where each of them fires a different event.


On Date Changed

This will be called every 0.05f when Tick() is called when time is advancing. You can hookup anything to this event that takes in a DateTime variable.


Clock Manager

This script is called when the OnDateChanged is called and then updates the UI and lights accordingly.


Date

  • This is where you would put your text to display the current Date.

Time

  • This is where you would put your text to display the current Time.

Season

  • This is where you would put your text to display the current Season.

Week

  • This is where you would put your text to display the current Week.

Sun Light

  • This is a reference to the sun in the world, so it can move and change intensity depending on the position and time of day.

Day Intensity

  • How bright the day would be.

Night Intensity

  • How bright the night would be.

Day Night Curve

  • How soon/late the sun will rise/set each day.

Sun Height Curve

How high the sun is per season.

  • Spring 60

  • Summer 80

  • Autumn 40

  • Winter 20

Recent Posts

See All
Terrain Generation

Required Packages Universal Render Pipeline (Available from the Package Manager) How To Use Main Scripts Map Preview This generates a...

 
 
 
Item / Weapon System

This system enables users to create custom items and weapons using a custom inspector built with Unity's new UI Builder Toolkit.

 
 
 
Crafting System

Physically based crafting system requiring your to place items onto the crafting table and select a recipe from the book that you would like

 
 
 

Comments


Subscribe for News and Updates

Thanks for subscribing!

  • Discord
  • itchio-textless-black
  • X
  • linkedin-square-logo
© 2024 by Bopbop Studios. All Rights Reserved.
bottom of page