// Update is called once per frame void UpdateClock(ClockProvider clockProvider) { clockLabel.text = clockProvider.hour.val.ToString("00") + ":" + clockProvider.minute.val.ToString("00") + ":" + clockProvider.second.val.ToString("00") + ":" + clockProvider.millisecond.ToString("000"); }
void Start() { clockProvider = ClockProvider.instance; clockProvider.second.OnChange += (int s) => { hand2.SetValue(clockProvider.fMinute / 60); hand3.SetValue(clockProvider.fSecond / 60); }; clockProvider.minute.OnChange += (int s) => { hand1.SetValue(clockProvider.fHour / 12); }; clockProvider.UpdateHandler += (ClockProvider cp) => { hand4.SetValue((float)cp.millisecond / 1000.0f); }; }
// Start is called before the first frame update void Start() { clockProvider = ClockProvider.instance; clockProvider.hour.OnChange += (int h) => { hourLabel.text = h.ToString(); }; clockProvider.minute.OnChange += (int m) => { minuteLabel.text = m.ToString("00"); }; clockProvider.second.OnChange += (int s) => { secondLabel.text = s.ToString("00"); }; clockProvider.UpdateHandler += (ClockProvider cp) => { millisecondDisplay.SetValue((float)cp.millisecond / 1000.0f); }; }