AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI_ValueEditItem_BoolEdit.cs

40 lines
870 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace AxibugEmuOnline.Client
{
public class OptionUI_ValueEditItem_BoolEdit : MonoBehaviour, IValueEditControl
{
[SerializeField]
Text txt_value;
private ValueSetMenu m_valueMenu;
public void SetData(ValueSetMenu valueMenu)
{
m_valueMenu = valueMenu;
txt_value.text = valueMenu.ValueRaw.ToString();
}
public void OnLeft()
{
OnExecute();
}
public void OnRight()
{
OnExecute();
}
public void OnExecute()
{
var value = (bool)m_valueMenu.ValueRaw;
value = !value;
txt_value.text = value.ToString();
m_valueMenu.OnValueChanged(value);
}
}
}