void CreateQuestionBank(string bankname) { UploadMessage.GetComponent <Text>().text = "Uploading..."; Debug.Log("Start to upload question bank " + bankname); ResultPanel.SetActive(true); // yield return fc.CreateQuestionBank(holder.BankName, holder.GetQuestionBank()); fc.CreateQuestionBank(bankname, holder.GetQuestionBank()).Then(result => { if (result) { // Show uploaded message and return to login page UploadMessage.GetComponent <Text>().text = "Succeed to Upload Question bank [" + bankname + "]. Now return to Login Page."; } else { UploadMessage.GetComponent <Text>().text = "Failed to Upload Question bank [" + bankname + "]. Please Try again later"; } Debug.Log("Wait 3 seconds to login page"); return(Timer.WaitFor(5f)); }).Then(() => { Debug.Log("Load scene Login"); SceneManager.LoadScene("Login"); }); }