Home > other >  Want to write a pointer into the button text color script, did not change when testing the pointer o
Want to write a pointer into the button text color script, did not change when testing the pointer o

Time:09-30

Wanted to write a pointer into the button text color script, which did not change when testing the pointer out of a project to see what problem under

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 (a);
The text, the text="& lt; Color=# 1757 e5 & gt;" + text. Text + "& lt;/color> ";
}

Public void OnPointerExit (PointerEventData EeventData)
{
The Text Text=BTN. Transform. GetComponentInChildren (a);
The text, the text="& lt; Color=# DE2929 & gt;" + text. Text + "& lt;/color> ";
}

}

CodePudding user response:

Problem has been resolved
  • Related