Пример #1
0
    // Update is called once per frame
    void Update()
    {
        int count = RuntimeGameDataManager.GetCount();

        countText.text = count.ToString();
        if (RuntimeGameDataManager.IsWin())
        {
            winText.text = "You Win!";
        }
    }
Пример #2
0
    // 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!";
            }
        }
    }