Exemplo n.º 1
0
 private void OnApplicationFocus(bool focus)
 {
     if (!focus)
     {
         SaveService?.SaveAll();
     }
 }
Exemplo n.º 2
0
 private void OnApplicationPause(bool pause)
 {
     if (pause)
     {
         SaveService?.SaveAll();
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 private void OnApplicationQuit()
 {
     SaveService?.SaveAll();
 }