1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-24 00:04:20 +00:00
beat-td/Assets/Scripts/ChangeSpriteOnHover.cs

28 lines
451 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ChangeSpriteOnHover : MonoBehaviour {
public Sprite enter;
public Sprite exit;
private Image image;
void Start()
{
image = gameObject.GetComponent<Image>();
}
void OnMouseEnter()
{
image.sprite = enter;
}
void OnMouseExit()
{
image.sprite = exit;
}
}