Exemplo n.º 1
0
        public static int?SetIntAndReturnPrevious(string key, int value)
        {
            int?result = null;

            if (UserPrefs.HasKey(key))
            {
                result = new int?(PlayerPrefs.GetInt(key));
            }
            UserPrefs.SetInt(key, value);
            return(result);
        }
Exemplo n.º 2
0
        protected virtual void CreateNewSession(DateTime toTime)
        {
            DateTime utcNow = DateTime.UtcNow;

            this.PreviousSessionDuration = toTime - this.StartTime;
            this.PauseDuration           = utcNow - this.PauseTime;
            if (this.PreviousSessionDuration.Milliseconds < 0)
            {
            }
            this.StartTime = utcNow;
            this.PauseTime = this.StartTime;
            this.SessionId++;
            this.FirstStart = false;
            UserPrefs.SetDateTime("AppSession.StartTime", this.StartTime);
            UserPrefs.SetDateTime("AppSession.PauseTime", this.PauseTime);
            UserPrefs.SetInt("AppSession.SessionId", this.SessionId);
            UserPrefs.SaveDelayed();
        }