1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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<Text>();
- 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<RectTransform>().anchoredPosition = new Vector2(this.transform.parent.GetComponent<RectTransform>().anchoredPosition.x, 99999);
- }
- }
|