Example #1
0
    public void DownloadButtonClicked()
    {
        //customView.GetComponent<CustomizeView>().DefaultValueSetting();

        try
        {
            string str = _userDrive.GetRecentPath();

            _pptID = _setManager.BShowcaseMgr.AddShowcase("_empty", 0, "/_empty", 30, 5);
            _setManager.BShowcaseMgr.EditShowcase_path(_pptID, (Application.persistentDataPath + "/" + _pptID));
            customView.GetComponent <CustomizeView>().SetPPTID(_pptID);

            bool isProgressbarStart = false;
            _userDrive.DonwloadAllFilesInFolder(str, Application.persistentDataPath + "/" + _pptID,
                                                delegate()
            {               /* completed Callback */
                                                        #if UNITY_EDITOR
                Debug.Log("fileDownLoad Complete");
                                                        #endif
                _userDrive.JobDone();
                _NaviStatus = NavigationStatus.NotProcessing;
                StartCoroutine("CompleteDownloading");
            }, delegate(int totalFileNum, int completedFileNum)              /* process Callback */
            {
                ProgressBar progressBar = progressCircle.GetComponent <ProgressBar>();

                if (completedFileNum == 0 && isProgressbarStart == false)
                {
                    isProgressbarStart = true;
                    ShowLoadingPanel();
                    progressBar.ResetProgress();
                }
                progressBar.StartProgress(completedFileNum, totalFileNum);
            }, delegate()
            {            /* Cancel Callback */
                                                        #if UNITY_EDITOR
                Debug.Log("fileDownLoad Canceled");
                                                        #endif
                _setManager.BShowcaseMgr.DeleteShowcase(_pptID);

                _userDrive.JobDone();
                _NaviStatus = NavigationStatus.NotProcessing;
                loadingView.SetActive(false);
            });
        }
        catch (Exception e)
        {
            _userDrive.JobDone();
            _NaviStatus = NavigationStatus.NotProcessing;
            Debug.Log(e.ToString());
        }
    }