using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TextLogCheck : MonoBehaviour { public GameObject center; public TaskManager tm; private void OnDisable() { center.SetActive(true); } private void OnEnable() { center.SetActive(false); Text t = this.GetComponent(); t.text = ""; for (int i = 0; i < tm.tconfigs.Count; i++) { if(i<=tm.nowTaskCt) { for (int j = 0; j < tm.tconfigs[i].items.Length; j++) { if (i < tm.nowTaskCt) { if(!tm.tconfigs[i].items[j].isNoshow) { if (tm.iidex == 1 && tm.tconfigs[i].items[j].info2 != "") t.text += "\n" + tm.tconfigs[i].items[j].info2 + "\n"; else { t.text += "\n" + tm.tconfigs[i].items[j].info + "\n"; } } } else if(j<=tm.nowTaskIndex) { if (!tm.tconfigs[i].items[j].isNoshow) { if (tm.iidex == 1 && tm.tconfigs[i].items[j].info2 != "") t.text += "\n" + tm.tconfigs[i].items[j].info2 + "\n"; else { t.text += "\n" + tm.tconfigs[i].items[j].info + "\n"; } } } } } } Invoke("refy",0.2f); } void refy() { this.transform.parent.GetComponent().anchoredPosition = new Vector2(this.transform.parent.GetComponent().anchoredPosition.x, 99999); } }