void ButtonAbortAndPercentageDownloadCSV() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); //button to abort if (GUILayout.Button("Abort Download")) { ManageDownloadCSV.AbortDownloadCSV(); return; //return to avoid error, because there will be no download to show percentage } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); //show percentage EditorGUILayout.Slider("Percentage:", ManageDownloadCSV.www.downloadProgress, 0f, 1f); //when complete, show error or Download Completed! if (ManageDownloadCSV.www.isDone) { if (ManageDownloadCSV.www.isHttpError || ManageDownloadCSV.www.isNetworkError) { EditorGUILayout.LabelField("Error:", ManageDownloadCSV.www.error, EditorStyles.boldLabel); } else { EditorGUILayout.LabelField("Download Completed!", EditorStyles.boldLabel); } } }
void ButtonDownloadCSV() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); //button to download CSV if (GUILayout.Button("Download CSV")) { ManageDownloadCSV.DownloadCSV(); } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); }