Exemplo n.º 1
0
        public void Awake()
        {
            /*
             * string path = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
             * path = path.Substring(0, path.LastIndexOf('/'));
             * downloadFolder = path + "/Documents/downloads";
             */
            //Debug.Log ("[GamedoniaFiles] Awake executed");
            downloadFolder = Application.persistentDataPath + "/downloads";
            downloads      = new ArrayList();
            downloadeds    = new ArrayList();

            downloadManager = new DownloadManager(downloadFolder);
            downloadManager.maxConcurrentDownloads = 4;

            _instance = this;

            downloadManager.DownloadDidFinishLoading += (object sender, DownloadManagerEvent e) => { if (DownloadDidFinishLoading != null)
                                                                                                     {
                                                                                                         this.DownloadDidFinishLoading(sender, e);
                                                                                                     }
            };
            downloadManager.DownloadDidFail += (object sender, DownloadManagerEvent e) => { if (DownloadDidFail != null)
                                                                                            {
                                                                                                this.DownloadDidFail(sender, e);
                                                                                            }
            };
            downloadManager.DownloadDidReceiveData += (object sender, DownloadManagerEvent e) => { if (DownloadDidReceiveData != null)
                                                                                                   {
                                                                                                       this.DownloadDidReceiveData(sender, e);
                                                                                                   }
            };
            downloadManager.DownloadDidStart += (object sender, DownloadManagerEvent e) => { if (DownloadDidStart != null)
                                                                                             {
                                                                                                 this.DownloadDidStart(sender, e);
                                                                                             }
            };
            downloadManager.DownloadDidFinishLoadingAll += (object sender, DownloadManagerEvent e) => { if (DownloadDidFinishLoadingAll != null)
                                                                                                        {
                                                                                                            this.DownloadDidFinishLoadingAll(sender, e);
                                                                                                        }
            };
            downloadManager.DownloadDidStartLoadingAllForManager += (object sender, DownloadManagerEvent e) => { if (DownloadDidStartLoadingAllForManager != null)
                                                                                                                 {
                                                                                                                     this.DownloadDidStartLoadingAllForManager(sender, e);
                                                                                                                 }
            };
        }
Exemplo n.º 2
0
        public void Awake()
        {
            /*
            string path = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
            path = path.Substring(0, path.LastIndexOf('/'));
            downloadFolder = path + "/Documents/downloads";
            */
            //Debug.Log ("[GamedoniaFiles] Awake executed");
            downloadFolder = Application.persistentDataPath + "/downloads";
            downloads = new ArrayList ();
            downloadeds = new ArrayList ();

            downloadManager = new DownloadManager(downloadFolder);
            downloadManager.maxConcurrentDownloads = 4;

            _instance = this;

            downloadManager.DownloadDidFinishLoading += (object sender, DownloadManagerEvent e) => { if (DownloadDidFinishLoading != null) this.DownloadDidFinishLoading (sender, e); };
            downloadManager.DownloadDidFail += (object sender, DownloadManagerEvent e) => { if (DownloadDidFail != null) this.DownloadDidFail (sender, e); };
            downloadManager.DownloadDidReceiveData += (object sender, DownloadManagerEvent e) => { if (DownloadDidReceiveData != null) this.DownloadDidReceiveData (sender, e); };
            downloadManager.DownloadDidStart += (object sender, DownloadManagerEvent e) => { if (DownloadDidStart != null) this.DownloadDidStart (sender, e); };
            downloadManager.DownloadDidFinishLoadingAll += (object sender, DownloadManagerEvent e) => { if (DownloadDidFinishLoadingAll != null) this.DownloadDidFinishLoadingAll (sender, e); };
            downloadManager.DownloadDidStartLoadingAllForManager += (object sender, DownloadManagerEvent e) => { if (DownloadDidStartLoadingAllForManager != null) this.DownloadDidStartLoadingAllForManager (sender, e); };
        }