天津23维预案
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.

37 lines
1.0 KiB

3 years ago
using UnityEngine;
using System.Collections;
using AX.NetworkSystem;
using UnityEngine.UI;
public class AllScoreMessage : MonoBehaviour {
public ScoreInfo score;
void Start()
{
transform.Find("Toggle").GetComponent<Toggle>().onValueChanged.AddListener(changeSelected);
}
void OnDestroy()
{
transform.Find("Toggle").GetComponent<Toggle>().onValueChanged.RemoveListener(changeSelected);
}
// Update is called once per frame
void Update()
{
}
public void setScore(ScoreInfo score)
{
this.score = score;
transform.Find("Creator").GetComponent<Text>().text = score.CreatorName;
transform.Find("CreateTime").GetComponent<Text>().text = score.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
transform.Find("Score").GetComponent<Text>().text = score.Score;
}
private void changeSelected(bool selected)
{
if (selected)
{
NetworkManager.Default.SendRequestAsync("GET_SCORE_DETAIL_INFOS_REQUEST", score.ID);
}
}
}