YunWeiZhiDao.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. using UnityEngine.Events;
  6. using XRTool.Util;
  7. public class YunWeiZhiDao : AbstractController
  8. {
  9. public GameObject donghua;
  10. public string defultstring;
  11. public TextMeshProUGUI textUI;
  12. public TextMeshProUGUI textUI2;
  13. public List<string> stringList = new List<string>();
  14. public List<string> stringList2 = new List<string>();
  15. public int count;
  16. public GameObject resetGo;
  17. public UnityEvent OnReset = new UnityEvent(); // ÖØÖÃʼþ
  18. Vector3 initPV3 = new Vector3(57f, -148f, -346f);
  19. Vector3 initEV3 = new Vector3(0, -21.11f, 0);
  20. public void nextTask()
  21. {
  22. Debug.Log("nextTasknextTasknextTasknextTask");
  23. textUI.text = stringList[count];
  24. textUI2.text = stringList2[count];
  25. count++;
  26. if (count >= stringList.Count)
  27. {
  28. resetGo.SetActive(true);
  29. }
  30. }
  31. public void back()
  32. {
  33. ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
  34. }
  35. private void Update()
  36. {
  37. #if UNITY_EDITOR
  38. //if (Test) return;
  39. return;
  40. #endif
  41. OnReset?.Invoke();
  42. }
  43. private void OnEnable()
  44. {
  45. textUI.text = defultstring;
  46. if (TimerMgr.Instance)
  47. {
  48. ResetDongHua();
  49. }
  50. }
  51. public void ResetDongHua()
  52. {
  53. textUI.text = defultstring;
  54. textUI2.text = "";
  55. resetGo.SetActive(false);
  56. count = 0;
  57. donghua.SetActive(false);
  58. TimerMgr.Instance.CreateTimer(() => {
  59. donghua.SetActive(true);
  60. }, 0.1f);
  61. donghua.transform.localPosition = initPV3;
  62. donghua.transform.localEulerAngles = initEV3;
  63. TimerMgr.Instance.CreateTimer(() => {
  64. count = 0;
  65. nextTask();
  66. }, 3f);
  67. }
  68. }