Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- public class swap : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
- {
- public Sprite image1;
- public Sprite image2;
- public void OnPointerDown(PointerEventData eventData)
- {
- GetComponent<Button>().image.sprite = image1;
- }
- public void OnPointerUp(PointerEventData eventData)
- {
- GetComponent<Button>().image.sprite = image2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment