using UnityEngine; using System.Collections; using AX.NetworkSystem; using AX.Network.Protocols; using System; using AX.TrackRecord; using System.IO; public class QUESTION_SAVE_REPLY : NetworkMessageBehaviour { protected override void Execute(BinaryMessage message) { var question= message.Body.Deserialize(); ExaminationQuestionDetail.question = question; //调用函数,创建考题xml文件 string file = "Questions/" + question.ID + "/" + question.FilePath;//这是文件在本地的完整路径 RecordManager.Instance.CreatAndSaveQuestion(file); //上传文件 string[] files = { file }; if (files.Length > 0) { if (GameObject.Find("FileTransTipWindow"))//如果已经存在文件传输窗口,不再相应 return; GameObject FileTransTipWin = Instantiate(Resources.Load("UIPrefab/FileTransTipWin")); FileTransTipWin.GetComponent().SetWindow( "UpLoad", files, TransferType.Upload); FileTransTipWinManager.task.TransferTaskCompleted += Task_TransferTaskCompleted; } } private void Task_TransferTaskCompleted() { FileTransTipWinManager.task.TransferTaskCompleted -= Task_TransferTaskCompleted; MySceneManager.BackToLastScene(); } }