Files
ZHGD_Web/Assets/Script/Tool/ButtonStateTool.cs

27 lines
474 B
C#
Raw Permalink Normal View History

2025-07-13 23:16:20 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ButtonStateTool : MonoBehaviour
{
public Sprite Normal;
public Sprite Select;
private Image image;
void Awake()
{
image = GetComponent<Image>();
}
public void StateCut(ButtonState State) {
image.sprite = State == ButtonState.Normal ? Normal : Select;
}
}
public enum ButtonState {
Normal,
Select
}