You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
3.2 KiB
92 lines
3.2 KiB
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
using AX.NetworkSystem; |
|
using AX.TrackRecord; |
|
using System; |
|
using System.IO; |
|
using AX.MessageSystem; |
|
|
|
public class ExaminationQuestionDetail : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
public static ExaminationQuestionObject question; |
|
public InputField questionName; |
|
public InputField questionInfo; |
|
void Start () { |
|
|
|
} |
|
|
|
// Update is called once per frame |
|
void Update () { |
|
|
|
} |
|
public void submitExaminationQuestion() |
|
{ |
|
string detail = ""; |
|
var questionNameStr = questionName.text.Trim(); |
|
var questionInfoStr = questionInfo.text.Trim(); |
|
if (string.IsNullOrEmpty(questionNameStr)) |
|
{ |
|
detail += "考题名称不能为空,"; |
|
} |
|
if (detail != "") |
|
{ |
|
detail = detail.Substring(0, detail.Length - 1); |
|
GameObject.Find("MessageBox").GetComponent<MessageTool>().showMessage(ShowMessageType.warning, "信息提示", detail); |
|
return; |
|
} |
|
if (questionNameStr.Contains("/") || questionNameStr.Contains("\\")) |
|
{ |
|
questionName.text = ""; |
|
MessageDispatcher.SendMessage("Operatinghints", (object)"名字不能包含/或\\"); |
|
return; |
|
} |
|
if (ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.EditQuestion) |
|
{ |
|
//删除原考题xml文件 |
|
string file_orign = ExamInfoHelpClass.CurrentWorkPath + "Questions/" + question.ID + "/" + question.FilePath; |
|
if (File.Exists(file_orign)) |
|
{ |
|
File.Delete(file_orign); |
|
} |
|
} |
|
question.Name = questionNameStr; |
|
question.Intro = questionInfoStr; |
|
question.FilePath = TrackRecordHelpClass.GetFileNameAccordingTime(DateTime.Now); |
|
question.CreatorName = MySelf.mySelf.Name; |
|
question.CreatorId = MySelf.mySelf.ID; |
|
question.Pattern = (int)ExamInfoHelpClass.applicationMode; |
|
NetworkManager.Default.SendRequestAsync("QUESTION_SAVE_REQUEST", question); |
|
gameObject.SetActive(false); |
|
} |
|
private void Task_TransferTaskCompleted() |
|
{ |
|
FileTransTipWinManager.task.TransferTaskCompleted -= Task_TransferTaskCompleted; |
|
MySceneManager.BackToLastScene(); |
|
} |
|
public void showDetail() |
|
{ |
|
if(SetPowerScript.Instance.modeType == ModeType.PartPower && SetPowerScript.Instance.TeamList.Count==0) |
|
{ |
|
MessageDispatcher.SendMessage("Operatinghints", (object)"请设置力量"); |
|
return; |
|
} |
|
if (SetPowerScript.Instance.modeType == ModeType.PartPower && SetPowerScript.Instance.TeamList.Count > 0) |
|
{ |
|
for (int i = 0; i < SetPowerScript.Instance.TeamList.Count; i++) |
|
{ |
|
TeamAttri Arrri = SetPowerScript.Instance.TeamList[i] as TeamAttri; |
|
if (Arrri.PowerAttriList.Count == 0) |
|
{ |
|
MessageDispatcher.SendMessage("Operatinghints", (object)(Arrri.TeamName+"中队未设置力量")); |
|
return; |
|
} |
|
} |
|
} |
|
|
|
gameObject.SetActive(true); |
|
questionName.text = question.Name; |
|
questionInfo.text = question.Intro; |
|
} |
|
}
|
|
|