XianSuoManager.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class XianSuoManager : MonoBehaviour
  5. {
  6. public GameObject xiansuo1;
  7. public GameObject xiansuo2;
  8. public TaskManager tm;
  9. private void OnEnable()
  10. {
  11. if (PlayerPrefs.GetInt("isend") != 1)
  12. {
  13. for (int i = 0; i <= tm.nowTaskCt; i++)
  14. {
  15. for (int j = 0; j < tm.nowTaskIndex; j++)
  16. {
  17. if (tm.tconfigs[i].TaskList[j].xiansuos != null)
  18. {
  19. Debug.Log("线索——"+ tm.tconfigs[i].TaskList[j].xiansuos.Count);
  20. if(!xiansuo1.activeSelf)
  21. xiansuo1.SetActive(tm.tconfigs[i].TaskList[j].xiansuos.Count > 0);
  22. if (!xiansuo2.activeSelf)
  23. xiansuo2.SetActive(tm.tconfigs[i].TaskList[j].xiansuos.Count > 1);
  24. }
  25. }
  26. }
  27. }
  28. else
  29. {
  30. xiansuo1.SetActive(true);
  31. xiansuo2.SetActive(true);
  32. }
  33. }
  34. }