public static void SaveDelayed(float delaySecs) { if (UserPrefs.MainExecutor != null) { if (UserPrefs.SavePending) { return; } UserPrefs.MainExecutor.PostDelayed(new Action(UserPrefs.Save), (double)delaySecs); UserPrefs.SavePending = true; } else { UserPrefs.Save(); } }
public virtual void Init() { DateTime utcNow = DateTime.UtcNow; this.FirstStartTime = UserPrefs.GetDateTime("GameState.FirstStartDateTime", DateTime.MinValue); if (this.FirstStartTime == DateTime.MinValue) { this.FirstStartTime = utcNow; UserPrefs.SetDateTime("GameState.FirstStartDateTime", this.FirstStartTime); UserPrefs.Save(); this.FirstStart = true; } this.StartTime = UserPrefs.GetDateTime("AppSession.StartTime", utcNow); this.PauseTime = UserPrefs.GetDateTime("AppSession.PauseTime", utcNow); this.SessionId = UserPrefs.GetInt("AppSession.SessionId", 0); this.AfterInit(); }