27 lines
474 B
C#
27 lines
474 B
C#
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
|
|
} |