GQ_Communicate/GQ_URP/GQ/Assets/script/巡检/PatrolRobotUI.cs

39 lines
745 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class PatrolRobotUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public GameObject img;
public Button button;
private void OnEnable()
{
img.SetActive(false);
}
// Start is called before the first frame update
void Start()
{
button = GetComponent<Button>();
}
// Update is called once per frame
void Update()
{
}
public void OnPointerEnter(PointerEventData eventData)
{
img.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
img.SetActive(false);
}
}