using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using TMPro; public class RobotBtn : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler { public TextMeshProUGUI textMeshProUGUI; private void Start() { textMeshProUGUI = GetComponentInChildren(); } public void OnPointerClick(PointerEventData eventData) { g1.SetActive(false); g2.SetActive(true); textMeshProUGUI.color = Color.white; } public void OnPointerEnter(PointerEventData eventData) { textMeshProUGUI.color = Color.black; } public void OnPointerExit(PointerEventData eventData) { textMeshProUGUI.color = Color.white; } //[SerializeField] Button Btn; [SerializeField] GameObject g1; [SerializeField] GameObject g2; // Start is called before the first frame update //void Start() //{ // Btn = transform.GetComponent