44 lines
917 B
C#
44 lines
917 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.UI;
|
|
using UnityEngine;
|
|
using WI;
|
|
using System;
|
|
using TMPro;
|
|
|
|
public class UI_FloorButton : UIBase
|
|
{
|
|
private Button button;
|
|
|
|
public Action<UI_FloorButton> onClickButton;
|
|
public int value;
|
|
|
|
public Color selectColor;
|
|
public Color originColor;
|
|
|
|
public void SettingButton(int value)
|
|
{
|
|
this.value = value;
|
|
|
|
button = GetComponent<Button>();
|
|
var buttonText = GetComponentInChildren<TMP_Text>();
|
|
buttonText.SetText($"{value + 1}F");
|
|
|
|
button.onClick.AddListener(OnClickButton);
|
|
originColor = button.image.color;
|
|
}
|
|
private void OnClickButton()
|
|
{
|
|
onClickButton?.Invoke(this);
|
|
}
|
|
public void SetChangeColor()
|
|
{
|
|
button.image.color = selectColor;
|
|
}
|
|
public void ResetColor()
|
|
{
|
|
button.image.color = originColor;
|
|
}
|
|
|
|
}
|