MapControl.cs 657 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class MapControl : MonoBehaviour
  6. {
  7. public TestMapShow minMap;
  8. public TestMapShow maxMap;
  9. public Text text;
  10. bool state = false;
  11. public void OnClick()
  12. {
  13. if(state)
  14. {
  15. maxMap.gameObject.SetActive(true);
  16. minMap.gameObject.SetActive(false);
  17. text.text = "小地图";
  18. }
  19. else
  20. {
  21. maxMap.gameObject.SetActive(false);
  22. minMap.gameObject.SetActive(true);
  23. text.text = "全局地图";
  24. }
  25. state = !state;
  26. }
  27. }