Esempio n. 1
0
        private void Start()
        {
            if (timer == null)
            {
                timer = new Timer(tickPeriod, 0, 0f, true);
            }

            if (!String.IsNullOrEmpty(buttonKey))
            {
                string _saveString = String.Empty;
                if (saveThisCountdown)
                {
                    _saveString         = BinaryPrefs.GetString(buttonKey);
                    waitForDelayExpired = BinaryPrefs.GetBool(buttonKey + waitForDelayExpiredKey, false);
                }

                if (!String.IsNullOrEmpty(_saveString))
                {
                    SetEndDate(Convert.ToDateTime(_saveString));

                    if (DateTime.Compare(DateTime.Now, endDate) < 0)
                    {
                        StartCountdown();
                    }
                    else if (waitForDelayExpired)
                    {
                        ResetCountdown();
                    }
                }
            }
            else
            {
                Debug.LogError("You need to specify a buttonName for the save");
            }
        }