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