- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
IEnumerator CalcTimeToEnd()
{
while (Work.TimeToEnd > 0)
{
Work.TimeToEnd -= 1;
Text timerText = questTimerBg.gameObject.transform.FindChild("Text").GetComponent<Text>();
int iHours = 0;
int iMunuts = 0;
int iSeconds = Quest.TimeToEnd;
if (iSeconds > 60)
{
iMunuts = iSeconds / 60;
iSeconds = iSeconds % 60;
}
if (iMunuts > 60)
{
iHours = iMunuts / 60;
iMunuts = iMunuts % 60;
}
string strTime = "";
if (iHours > 0)
strTime = iHours.ToString() + ":";
if (iMunuts < 10)
strTime += "0";
strTime += iMunuts.ToString() + ":";
if (iSeconds < 10)
strTime += "0";
strTime += iSeconds.ToString();
timerText.text = strTime;
yield return new WaitForSeconds(1f);
}
Work.SetState(EQuestState.eQS_ABORT);
}