forked from sin365/AxibugEmuOnline
40 lines
870 B
C#
40 lines
870 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|