using System.Collections; using System.Collections.Generic; using UnityEngine; using AdamThinkDevicesData; using static InterfaceManager; using Newtonsoft.Json; using UnityEngine.UI; /// /// 态势显示 /// public class SituationDisplay : MonoBehaviour { /// /// /// public Transform Content; /// /// 预制体 /// public GameObject txtViewPrefab; /// /// 接收条数 /// public int NumberOfAcceptances = 0; // Start is called before the first frame update void Start() { Debug.Log(GlobalFlag.currentThinkId); Debug.Log(GlobalFlag.practiceSubjectID); StartCoroutine(GetString(Url_Querypracticelog, 5, data => { Debug.Log(data); ReceivingLogMain receivingLogMain = new ReceivingLogMain(); receivingLogMain = JsonConvert.DeserializeObject(data); for (int i = NumberOfAcceptances; i < receivingLogMain.data.Count; i++) { NumberOfAcceptances++; GameObject txtView = Instantiate(txtViewPrefab, Content); Text _text = txtView.GetComponentInChildren(); _text.text = receivingLogMain.data[i].log; txtView.transform.SetAsFirstSibling(); txtView.SetActive(true); } })); } // Update is called once per frame void Update() { } }