How to start Day so it is Day 1 and not Day 0 ?
When I start the game it says Day 1 everything is fine, but when I reach day 8 it changes to day 0 and I want it to change to day 1, what should I add? Main code is at the top.
private void FormatText1() {
int week = (int)(1 + timer1 / 10080);
int days = (int)(1 + timer1 / 1440) % 8;
int hours = (int)(timer1 / 60) % 24;
int minutes = (int)(timer1) % 60;
DaysText.text = "Day : " + days;
WeekText.text = "Week : " + week;
if (minutes == 0)
{
MinutesText.text = "00";
}
if (minutes <= 9)
{
MinutesText.text = "0"+ minutes;
}else if (minutes >= 10)
{
MinutesText.text = "" + minutes;
}
if (hours == 0)
{
HoursText.text = "00";
}
if (hours <= 9)
{
HoursText.text = "0" + hours;
}else if (hours >= 10)
{
HoursText.text = "" + hours;
}
Comment
Your answer
Follow this Question
Related Questions
How to create a timer that only increases when if command is true? 1 Answer
20 minute countdown timer 2 Answers
How do I store a time value in a variable. 1 Answer
why the Timer isn't working 0 Answers
I make a timing score script in unity 2D, how i make high score of time?? Script is as follow: 1 Answer