1234567891011121314151617181920212223242526272829303132 |
- using UnityEngine;
- using UnityEngine.UI;
- public class YiChangJingGaoItem : MonoBehaviour
- {
- public YiChangJingGaoData currentData;
- private Text _timeText;
- private Text _posText;
- private Text _typeText;
- private Text _infoText;
- private Text _stateText;
-
- public void Init()
- {
- _timeText = this.transform.Find("time").GetComponent<Text>();
- _posText = this.transform.Find("pos").GetComponent<Text>();
- _typeText = this.transform.Find("type").GetComponent<Text>();
- _infoText = this.transform.Find("info").GetComponent<Text>();
- _stateText = this.transform.Find("state").GetComponent<Text>();
- }
- public void SetData(YiChangJingGaoData data)
- {
- currentData = data;
- _timeText.text = currentData.time;
- _posText.text = currentData.pos;
- _typeText.text = currentData.type;
- _infoText.text = currentData.info;
- _stateText.text = currentData.state;
- }
- }
|