Exemplo n.º 1
0
        protected virtual IEnumerator InitializeInternal()
        {
            var databaseName = this.config.DatabaseName;
            var versionKey   = this.config.VersionPrefsKey;

            var originPath = SqliteUtils.GetOriginPath(databaseName);
            var targetPath = SqliteUtils.GetTargetPath(databaseName);

            if (!PlayerPrefs.HasKey(versionKey))
            {
                yield return(SqliteUtils.ReinstallDatabase(originPath, targetPath));

                PlayerPrefs.SetInt(versionKey, this.config.Version);
                yield break;
            }

            yield return(SqliteUtils.InstallDatabaseIfAbsent(originPath, targetPath));

            yield return(this.CheckForUpdates());
        }