Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (!end)
     {
         clock.UpdateTime();
         drawingScript.UpdateGui(clockText, clock.RefactorTime(clock.GetTime()));
     }
 }
 //If the player chooses to save the game, then save the game
 public void YesSave()
 {
     clock.days    = clock.days + 1;
     clock.hours   = 6;
     clock.minutes = 0;
     //Update the day of the week
     if (clock.dayoftheWeek == "Sunday")
     {
         clock.dayoftheWeek = "Monday";
     }
     else if (clock.dayoftheWeek == "Monday")
     {
         clock.dayoftheWeek = "Tuesday";
     }
     else if (clock.dayoftheWeek == "Tuesday")
     {
         clock.dayoftheWeek = "Wednesday";
     }
     else if (clock.dayoftheWeek == "Wednesday")
     {
         clock.dayoftheWeek = "Thursday";
     }
     else if (clock.dayoftheWeek == "Thursday")
     {
         clock.dayoftheWeek = "Friday";
     }
     else if (clock.dayoftheWeek == "Friday")
     {
         clock.dayoftheWeek = "Saturday";
     }
     else
     {
         clock.dayoftheWeek = "Sunday";
     }
     clock.UpdateTime();
     SaveGame();
     saveOption.SetActive(false);
 }