using GLTFast; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class SelectIn : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler { public Sprite InUI; public Sprite OutUI; public bool selected=false; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void OnPointerClick(PointerEventData eventData) { } public void OnPointerEnter(PointerEventData eventData) { if (!selected) { this.GetComponent().sprite = InUI; } } public void OnPointerExit(PointerEventData eventData) { if (!selected) { this.GetComponent().sprite = OutUI; } } private void OnDisable() { this.GetComponent().sprite = OutUI; } }