using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class Operatingkey : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { /// /// 操作说明任务模式 /// public GameObject 操作说明任务模式; /// /// 操作说明任务模式 /// public GameObject 操作说明自由模式; /// /// Mask /// public GameObject Mask; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void OnPointerEnter(PointerEventData eventData) { //课程任务模式下触发得UI if (GameManager.current_main_menu_type == MainMenuType.课程任务) { 操作说明任务模式.SetActive(true); } else { 操作说明自由模式.SetActive(true); } Mask.GetComponent().enabled = true; } public void OnPointerExit(PointerEventData eventData) { //课程任务模式下触发得UI if (GameManager.current_main_menu_type == MainMenuType.课程任务) { 操作说明任务模式.SetActive(false); } else { 操作说明自由模式.SetActive(false); } Mask.GetComponent().enabled = false; } }