Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / UI / ButtonManegement.cs
@Rackday Rackday on 18 Aug 622 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. using UnityEngine.UI;
  6. public class ButtonManegement : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
  7. {
  8. private Text text;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. text = GetComponentInChildren<Text>();
  13. }
  14. public void OnPointerEnter(PointerEventData eventData)
  15. {
  16. text.color = Color.red; //Or however you do your color
  17. }
  18. public void OnPointerExit(PointerEventData eventData)
  19. {
  20. text.color = Color.black;
  21. }
  22. }