public bool GetFileListFromPath(string path, bhClowdDriveAPI.fileList_Callback callback) { if (_type == eCloudType.NotSelected) return false; bool res = false; switch (_type) { case eCloudType.bCloudDrive: { res = _bDriveAPI.GetFileListFromPath(path, callback); } break; case eCloudType.GoogleDrive: { res = true; string resPath = path; if (path == "/") { resPath = ""; } _bGoogleAPI.GetSelectedFolderFileList(resPath, callback); } break; } return res; }
public void Initialize(int type) { if (_bGoogleAPI == null) { #if UNITY_EDITOR Debug.LogError("Call Setup First !!"); #endif } switch (type) { case 1: _type = eCloudType.bCloudDrive; _bDriveAPI = new bDropboxAPI(); break; case 2: _type = eCloudType.GoogleDrive; break; case 3: _type = eCloudType.bCloudDrive; _bDriveAPI = new bLocalDriveAPI(); break; } }
public void StartAuthentication(bhClowdDriveAPI.Authentication_Callback callback) { if (_type == eCloudType.NotSelected) return; switch (_type) { case eCloudType.bCloudDrive: { _bDriveAPI.StartAuthentication(callback); } break; case eCloudType.GoogleDrive: { _bGoogleAPI.StartAuthentication(callback); } break; } }
public void Initialize(int type){ if (_bGoogleAPI == null) { #if UNITY_EDITOR Debug.LogError("Call Setup First !!"); #endif } switch (type) { case 1: _type = eCloudType.bCloudDrive; _bDriveAPI = new bDropboxAPI (); break; case 2: _type = eCloudType.GoogleDrive; break; case 3: _type = eCloudType.bCloudDrive; _bDriveAPI = new bLocalDriveAPI(); break; } }
public void Revoke(bhClowdDriveAPI.revoke_Callback callback){ if (_revokeInProgress == true) return; _revoke_callback = callback; StartCoroutine (Revock_internal ()); }
public void FileDownloadAll(string loadFolderName, string saveFolderPath, bhClowdDriveAPI.fileDownload_Callback callback, bhClowdDriveAPI.fileDownload_Process_Callback proceed_callback, bhClowdDriveAPI.fileDownload_Cancel_Callback cancel_callback ){ if (_isFileDownloadProcessing == true) return; _fileDownload_callback = callback; _fileDownload_proceed_callback= proceed_callback; _fileDownload_cancel_callback = cancel_callback; StartCoroutine(DonwloadAllFilesInFolder_internal (loadFolderName, saveFolderPath) ); }
public void GetCurrParentFileList (bhClowdDriveAPI.fileList_Callback callback){ if (_drive == null || _isUpdateListProcessing == true) return; _isUpdateListDone = false; _updateList_callback = callback; _isUpdateListProcessing = true; int parentIdx = currPath.Count - 1; if (parentIdx < 0) parentIdx = 0; if (parentIdx != 0) { currPath.RemoveAt(currPath.Count - 1); } parentIdx -= 1; if (parentIdx < 0) parentIdx = 0; string bbbRes = currPath[parentIdx]; StartCoroutine (GetFileLists_internal (bbbRes, delegate() { _isUpdateListDone = true; _isUpdateListProcessing = false; })); }
public void GetSelectedFolderFileList(string _selectedFolderName, bhClowdDriveAPI.fileList_Callback callback){ if (_drive == null || _isUpdateListProcessing == true) return; _isUpdateListDone = false; _updateList_callback = callback; _isUpdateListProcessing = true; /* if (recentFolderID != "none") { parentFolderID = recentFolderID; }*/ string id = ""; if (_selectedFolderName != "") { /* string removedLastWhiteSpace = ""; for (int i = 0; i < _selectedFolderName.Length - 1; i++) { removedLastWhiteSpace += _selectedFolderName [i]; }*/ //bool res = _filesDictionary.ContainsKey (_selectedFolderName); if (_filesDictionary != null &&_filesDictionary.ContainsKey(_selectedFolderName)) { id = _filesDictionary [_selectedFolderName].ID; } recentFolderName = _selectedFolderName; bool isDuplicated = false; foreach(string Path in currPath){ if (Path == id) { isDuplicated = true; } } if (!isDuplicated) { currPath.Add (id); } }else{ recentFolderID = id; recentFolderName = _selectedFolderName; //parentFolderID = ""; currPath.Add (""); } StartCoroutine (GetFileLists_internal (id, delegate() { _isUpdateListDone = true; _isUpdateListProcessing = false; })); }
public void StartAuthentication(bhClowdDriveAPI.Authentication_Callback callback){ /* * Autentciation checking * If _initInProgress == false, this means drive need autentication * and _initInProgress == true, this means drive doesn't need autentication process */ Initialize(); _authen_callback = callback; if (_initInProgress == false) { _isAuthenticationDone = false; StartCoroutine (StartAuthentication_internal (delegate(bool res, int resCode) { _isAuthenticationDone = true; _AuthenticationResCode = resCode; if(res) _isAuthenticationSucceed = true; else _isAuthenticationSucceed = false; },0)); } }
public void Revoke(bhClowdDriveAPI.revoke_Callback callback){ if (_type == eCloudType.NotSelected) return ; switch (_type) { case eCloudType.bCloudDrive: { _bDriveAPI.Revoke(callback); } break; case eCloudType.GoogleDrive: { _bGoogleAPI.Revoke (callback); } break; } return; }
//public bool DownloadFile(string filename, string savePath, string saveName, bhClowdDriveAPI.fileDownload_Callback callback); public bool DonwloadAllFilesInFolder(string loadFolderPath, string saveFolderPath, bhClowdDriveAPI.fileDownload_Callback callback, bhClowdDriveAPI.fileDownload_Process_Callback proceed_callback, bhClowdDriveAPI.fileDownload_Cancel_Callback cancel_callback) { if (_type == eCloudType.NotSelected) return false; bool res = false; switch (_type) { case eCloudType.bCloudDrive: { res = _bDriveAPI.DonwloadAllFilesInFolder(loadFolderPath, saveFolderPath, callback, proceed_callback, cancel_callback); } break; case eCloudType.GoogleDrive: { res = true; string resPath = loadFolderPath; if (loadFolderPath == "/") { resPath = ""; } _bGoogleAPI.FileDownloadAll(loadFolderPath, saveFolderPath, callback, proceed_callback, cancel_callback); } break; } return res; }
public bool GetSelectedFolderFileList(string _selectedFolderName, bhClowdDriveAPI.fileList_Callback callback) { if (_type == eCloudType.NotSelected) return false; bool res = false; switch (_type) { case eCloudType.bCloudDrive: { res = _bDriveAPI.GetSelectedFolderFileList(_selectedFolderName, callback); } break; case eCloudType.GoogleDrive: { res = true; _bGoogleAPI.GetSelectedFolderFileList(_selectedFolderName, callback); } break; } return res; }
public bool GetCurrParentFileList(bhClowdDriveAPI.fileList_Callback callback) { if (_type == eCloudType.NotSelected) return false; bool res = false; switch (_type) { case eCloudType.bCloudDrive: { res = _bDriveAPI.GetCurrParentFileList(callback); } break; case eCloudType.GoogleDrive: { res = true; _bGoogleAPI.GetCurrParentFileList(callback); } break; } return res; }