Advertisement
Guest User

Unity Button Code

a guest
Aug 3rd, 2022
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. using UnityEngine.UI;
  6.  
  7. public class ButtonCode : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
  8. {
  9. public UnityEngine.UI.Text thisText;
  10.  
  11. public void OnPointerEnter(PointerEventData eventData)
  12. {
  13. thisText.color = Color.yellow;
  14. }
  15.  
  16. public void OnPointerExit(PointerEventData eventData)
  17. {
  18. thisText.color = Color.white;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement