Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Stage/level change in Unity

Discussion in 'Scripting' started by Damonss, Mar 10, 2020.

  1. Damonss

    Damonss

    Joined:
    Jan 29, 2019
    Posts:
    6
    So, i want to create a game that have to change it's level and event after passing a day in-game (You could think about Paper's Please, the game give new event and changes in gameplay when the day changes). What's the most efficient way to make this mechanics?
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,590
    I'm not super familiar with Paper's Please, but i believe you want, for example, the difficulty to ramp up every day as well as some other things to happen?

    From what you said, you are already keeping track of the ingame time, so you have a way to see if the day changed. You could now simply create an integer 'dayNumber' where you keep track of which day it is. When your timer reaches the end of a day, increment dayNumber and call a function containing a switch-case. In the switch case you can define all the things you want to change / happen once a specific day number was reached - for example display a dialog, increase difficulty, show score, ....

    If with 'changing the level' you instead meant to change the scene looks and so on as well, then you probably just want to load a new scene.
     
    Damonss likes this.
  3. Damonss

    Damonss

    Joined:
    Jan 29, 2019
    Posts:
    6
    Thank you very much!