The script is as follows:
using UnityEngine;
Using UnityEngine. EventSystems;
Using UnityEngine. UI;
Public class ChangeBtnTColor_mulu: MonoBehaviour IPointerEnterHandler, IPointerExitHandler
{
Private Text Text;
Public GameObject BTN.
Void the Start ()
{
}
Public void OnPointerEnter (PointerEventData EeventData)
{
The Text Text=BTN. Transform. GetComponentInChildren
The text, the text="& lt; Color=# 1757 e5 & gt;" + text. Text + "& lt;/color> ";
}
Public void OnPointerExit (PointerEventData EeventData)
{
The Text Text=BTN. Transform. GetComponentInChildren
The text, the text="& lt; Color=# DE2929 & gt;" + text. Text + "& lt;/color> ";
}
}
CodePudding user response:
Problem has been resolved