mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-27 17:34:18 +00:00
28 lines
451 B
C#
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;
|
|
}
|
|
|
|
}
|