WindowManager.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class WindowManager : MonoBehaviour
  7. {
  8. [DllImport("__Internal")]
  9. private static extern void Hello(string str);
  10. [DllImport("__Internal")]
  11. private static extern void HelloString(string str);
  12. [DllImport("__Internal")]
  13. private static extern float HelloFloat();
  14. public static WindowManager Instance;
  15. private void Awake()
  16. {
  17. Instance = this;
  18. }
  19. public List<GameObject> KangFuDaList;
  20. public List<GameObject> golist;
  21. public void show(int index)
  22. {
  23. for (int i = 0; i < golist.Count; i++)
  24. {
  25. if(i!=index)
  26. {
  27. golist[i].SetActive(false);
  28. }
  29. }
  30. golist[index].SetActive(true);
  31. }
  32. public void back()
  33. {
  34. for (int i = 0; i < golist.Count; i++)
  35. {
  36. golist[i].SetActive(false);
  37. }
  38. }
  39. void Start()
  40. {
  41. }
  42. public void webcall()
  43. {
  44. Hello("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxba8be9d5a23ecefb&secret=34aaa3c52f1ce34c291311d01d5851a1");
  45. // HelloString("This is a string.");
  46. }
  47. }