// Update is called once per frame void Update() { int count = RuntimeGameDataManager.GetCount(); countText.text = count.ToString(); if (RuntimeGameDataManager.IsWin()) { winText.text = "You Win!"; } }
// Update is called once per frame void _UpdateData() { // observer pattern int uiDataStamp = RuntimeGameDataManager.GetDataStamp(); if (uiDataStamp != _uiDataStamp) { _uiDataStamp = uiDataStamp; // update ui data stamp int count = RuntimeGameDataManager.GetCount(); countText.text = count.ToString(); if (RuntimeGameDataManager.IsWin()) { winText.text = "You Win!"; } } }