コード例 #1
0
 public SaveLoadService(ArchiveService <T> archiveService,
                        MessagesControllerBase messagesController)
 {
     if (archiveService == null)
     {
         Debug.LogError("Archive Service is null, save load service cant work without it");
         return;
     }
     Application.quitting += OnApplicationQuitting;
     path = Application.persistentDataPath + @"\" + Filename;
     this.archiveService     = archiveService;
     this.messagesController = messagesController;
 }
コード例 #2
0
        public SaveLoadService(ArchiveService <T> archiveService,
                               MessagesControllerBase messagesController, bool autoSave, float saveInterval) : this(archiveService,
                                                                                                                    messagesController)
        {
            this.archiveService     = archiveService;
            this.saveInterval       = saveInterval;
            this.messagesController = messagesController;
            autoSaveEnabled         = autoSave;

            if (autoSaveEnabled)
            {
                StartAutoSaveRoutine();
            }
        }