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