using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; public class Highlight_XuanCheng : MonoBehaviour,IPointerEnterHandler,IPointerExitHandler { public Sprite sprite_old; public Sprite sprite; public GameObject game; private void Awake() { sprite_old = GetComponent().sprite; } public void OnPointerEnter(PointerEventData eventData) { GetComponent().sprite = sprite; game.SetActive(true); } public void OnPointerExit(PointerEventData eventData) { GetComponent().sprite = sprite_old; game.SetActive(false); } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }