Пример #1
0
 private void OnApplicationFocus(bool focus)
 {
     if (!focus)
     {
         SaveService?.SaveAll();
     }
 }
Пример #2
0
 private void OnApplicationPause(bool pause)
 {
     if (pause)
     {
         SaveService?.SaveAll();
     }
 }
Пример #3
0
        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();
        }
Пример #4
0
 private void OnApplicationQuit()
 {
     SaveService?.SaveAll();
 }