Пример #1
0
        void Awake()
        {

            if (Controller == null)
            {
                DontDestroyOnLoad(gameObject);
                Controller = this;

                if (Registery == null)
                {
                    Registery = new Registery(startingScene);
                    Registery.snapshot.UpdateTime();
                }

            }
            else if (Controller != this)
            {
                Destroy(gameObject);
            }
        }
Пример #2
0
 public void LoadGameFromSnapshot(RegisterySnapshot snap)
 {
     Registery = LoadRegisteryFromFile(snap);
     Registery.snapshot.UpdateTime();
     SceneManager.LoadScene(snap.lastScene);
 }
Пример #3
0
 private Registery CreateRegisteryFromSnapshot(RegisterySnapshot snap)
 {
     Registery registery = new Registery(startingScene);
     registery.snapshot = snap;
     return registery;
 }