示例#1
0
    public void UpdateTime()
    {
        int hour    = time.GetHour();
        int minutes = (time.tickCounter % (60 / time.tickSize)) * time.tickSize;

        timeText.text = ((hour > 12) ? hour - 12 : hour).ToString() + ":" + ((minutes < 10) ? "0" : "") + minutes.ToString();
        AM_PM.text    = (hour >= 12) ? "PM" : "AM";
    }