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.
41 lines
1.3 KiB
41 lines
1.3 KiB
using UnityEngine; |
|
using System.Collections; |
|
using UnityEngine.UI; |
|
using AX.MessageSystem; |
|
public class ExaminationQuestionSelectedMessage : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
public ExaminationQuestionObject question; |
|
void Start() |
|
{ |
|
transform.Find("Toggle").GetComponent<Toggle>().onValueChanged.AddListener(changeList); |
|
} |
|
void OnDestroy() |
|
{ |
|
transform.Find("Toggle").GetComponent<Toggle>().onValueChanged.RemoveListener(changeList); |
|
} |
|
// Update is called once per frame |
|
void Update() |
|
{ |
|
|
|
} |
|
public void setQuestion(ExaminationQuestionObject question) |
|
{ |
|
this.question = question; |
|
transform.Find("QuestionName").GetComponent<Text>().text = question.Name; |
|
transform.Find("Creator").GetComponent<Text>().text = question.CreatorName; |
|
transform.Find("CreateTime").GetComponent<Text>().text = question.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"); |
|
} |
|
private void changeList(bool selected) |
|
{ |
|
if (selected) |
|
{ |
|
ExaminationPaperDetail.questionId.Add(question.ID.ToString()); |
|
} |
|
else |
|
{ |
|
ExaminationPaperDetail.questionId.Remove(question.ID.ToString()); |
|
} |
|
MessageDispatcher.SendMessage("REFRESH_PAPER_UI"); |
|
} |
|
}
|
|
|