Daytime Nighttime Cycles

👍

Reminder - Keep Daily Backups

When working on a strategy game with a kit as big as the Complete Kit - always keep a working daily backup! Save yourself the trouble of rolling-back changes and losing work.

The City Building Complete Kit includes weather and day-night cycles. These are connected, with 2 revolving ambient sound sources and fade in-out effects. You can disable or enable day/night cycles and also adjust the transition time (in minutes) and length.

Open the Scripts/SFX/DayNight.cs script to edit.

334

Nighttime Example

954

Click for larger image.

How to Disable Daytime / Nighttime Cycles

Open the scenes/Game scene. In the Hierarchy you'll see AmbientController. Click this to open the Inspector.

210

Game scene hierarchy > GameManager > AmbientController. Click for larger image.

From the AmbientController Inspector, locate the Transition On checkbox under the Day Night (Script). Uncheck to disable the DayNight.cs transitions.

319

Uncheck to disable transitions. Click for larger image.

Excerpt from DayNight.cs which activates the transition cycle from day to night.

void Start () {	

  // Checks if the transitionOn bool is set to true (checked)
		if(transitionOn)
		InvokeRepeating("Transition",transitionInterval*60,transitionInterval*60);
    //converts transition intervals from minutes seconds
	}

Change Transition Speeds

Also on the Inspector menu you can change the transition interval (in minutes) to adjust how long the cycles last and how fast the transition speed (in minutes).

319

Update the transition speed (in minutes) on in Inspector menu. Click for larger image.

Rain and Snow Cylces

To learn more about rain and snow cycles in the City Building Complete Kit, please click on the menu "Weather" on the left under Gameplay to learn more.