private void OnApplicationFocus(bool focus) { if (!focus) { SaveService?.SaveAll(); } }
private void OnApplicationPause(bool pause) { if (pause) { SaveService?.SaveAll(); } }
private IEnumerator RegisterSaveablesImpl() { yield return(new WaitUntil(() => ResourceService.IsLoaded)); foreach (var pair in services) { if ((pair.Value is SaveableGameBehaviour)) { ((SaveableGameBehaviour)pair.Value).Register(); } else if (pair.Value is SaveableGameElement) { ((SaveableGameElement)pair.Value).Register(); } else if (pair.Value is ISaveable) { SaveService.Register(((ISaveable)pair.Value)); } } StartUpdateResume(); }
private void OnApplicationQuit() { SaveService?.SaveAll(); }