TextLogCheck.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class TextLogCheck : MonoBehaviour
  6. {
  7. public GameObject center;
  8. public TaskManager tm;
  9. private void OnDisable()
  10. {
  11. center.SetActive(true);
  12. }
  13. private void OnEnable()
  14. {
  15. center.SetActive(false);
  16. Text t = this.GetComponent<Text>();
  17. for (int i = 0; i < tm.tconfigs.Count; i++)
  18. {
  19. if(i<=tm.nowTaskCt)
  20. {
  21. for (int j = 0; j < tm.tconfigs[i].TaskList.Count; j++)
  22. {
  23. if (i < tm.nowTaskCt)
  24. {
  25. if(!tm.tconfigs[i].TaskList[j].isNoshow)
  26. {
  27. if (tm.iidex == 1 && tm.tconfigs[i].TaskList[j].info2 != "")
  28. t.text += "\n" + tm.tconfigs[i].TaskList[j].info2 + "\n";
  29. else
  30. {
  31. t.text += "\n" + tm.tconfigs[i].TaskList[j].info + "\n";
  32. }
  33. }
  34. }
  35. else if(j<=tm.nowTaskIndex)
  36. {
  37. if (!tm.tconfigs[i].TaskList[j].isNoshow)
  38. {
  39. if (tm.iidex == 1 && tm.tconfigs[i].TaskList[j].info2 != "")
  40. t.text += "\n" + tm.tconfigs[i].TaskList[j].info2 + "\n";
  41. else
  42. {
  43. t.text += "\n" + tm.tconfigs[i].TaskList[j].info + "\n";
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }