예제 #1
0
        //initiates the download process of your remotely hosted
        //config file for virtual products. Differs between types:
        //cached: stores config on the device, changes on next bootup
        //overwrite: only preserves changes in the current session
        private IEnumerator RemoteDownload()
        {
            //build file url
            string url = serverUrl + remoteFileName;

            switch (remoteType)
            {
            case RemoteType.cached:
                //load cached file string and overwrite virtual IAPs
                DBManager.LoadRemoteConfig();
                //download new config
                yield return(StartCoroutine(Download(url)));

                //save downloaded file
                DBManager.SaveRemoteConfig(request.text);
                break;

            case RemoteType.overwrite:
                //download new config
                yield return(StartCoroutine(Download(url)));

                //parse string and overwrite virtual IAPs
                DBManager.ConvertToIAPs(request.text);
                break;
            }
        }