29 lines
527 B
C#
29 lines
527 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BtnImage : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
Sprite img;
|
|
|
|
[SerializeField]
|
|
Sprite hoverImg;
|
|
/// <summary>
|
|
/// 点击按钮更换的图片
|
|
/// </summary>
|
|
public void OnEnterBtn()
|
|
{
|
|
GetComponent<Image>().sprite = hoverImg;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 推出按钮更换的图片
|
|
/// </summary>
|
|
public void OnExitBtn()
|
|
{
|
|
GetComponent<Image>().sprite = img;
|
|
}
|
|
}
|