XianSuoManager.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. int cts = tm.nowTaskIndex;
  16. if(tm.nowTaskCt>i)
  17. {
  18. cts = tm.tconfigs[i].items.Length;
  19. }
  20. for (int j = 0; j < cts; j++)
  21. {
  22. Debug.Log(j+"_"+i + "_线索——" + tm.tconfigs[i].items[j].xiansuos.Length);
  23. if (tm.tconfigs[i].items[j].xiansuos != null)
  24. {
  25. if(!xiansuo1.activeSelf)
  26. xiansuo1.SetActive(tm.tconfigs[i].items[j].xiansuos.Length > 0);
  27. if (!xiansuo2.activeSelf)
  28. xiansuo2.SetActive(tm.tconfigs[i].items[j].xiansuos.Length > 1);
  29. }
  30. }
  31. }
  32. }
  33. else
  34. {
  35. xiansuo1.SetActive(true);
  36. xiansuo2.SetActive(true);
  37. }
  38. }
  39. }