private async void UploadFileAsync()
        {
            m_IsUploading = true;
            m_FileId      = "";
            m_FileURL     = "";

            await Task.Run(() =>
            {
                m_FileId  = DriveAPI.UploadFile(m_MediaType, m_UploadName, m_FilePath);
                m_FileURL = DriveAPI.GetFileURL(m_FileId);
            });

            Repaint();
            m_IsUploading = false;
        }
Esempio n. 2
0
        private async void UploadFileAsync()
        {
            m_IsUploading = true;
            m_FileId      = "";
            m_FileURL     = "";

            var filePath = AssetDatabase.GetAssetPath(m_UploadAsset);
            await Task.Run(() =>
            {
                var mediaType = MediaSettings.GetMediaFromPath(filePath);
                m_FileId      = DriveAPI.UploadFile(mediaType, m_UploadName, filePath);
                m_FileURL     = DriveAPI.GetFileURL(m_FileId);
            });

            Repaint();
            m_IsUploading = false;
        }