namespace UIWidgets.Menu
{
using System.ComponentModel;
using System.Runtime.CompilerServices;
using UIWidgets.l10n;
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
#endif
///
/// Menu item.
///
public class MenuItem : IObservable, INotifyPropertyChanged
{
string name;
///
/// Name.
///
public string Name
{
get
{
return name;
}
set
{
if (name != value)
{
name = value;
NotifyPropertyChanged("Name");
}
}
}
string template;
///
/// Template.
///
public string Template
{
get
{
return template;
}
set
{
if (template != value)
{
template = value;
NotifyPropertyChanged("Template");
}
}
}
bool isChecked;
///
/// Checked.
///
public bool Checked
{
get
{
return isChecked;
}
set
{
if (isChecked != value)
{
isChecked = value;
NotifyPropertyChanged("Checked");
}
}
}
Sprite icon;
///
/// Icon.
///
public Sprite Icon
{
get
{
return icon;
}
set
{
if (icon != value)
{
icon = value;
NotifyPropertyChanged("Icon");
}
}
}
HotKey hotKey;
///
/// Hot Key.
///
public HotKey HotKey
{
get
{
return hotKey;
}
set
{
if (hotKey != value)
{
DestroyInputAction();
hotKey = value;
CreateHotKeyAction();
NotifyPropertyChanged("HotKey");
}
}
}
bool visible = true;
///
/// Is item visible?
///
public bool Visible
{
get
{
return visible;
}
set
{
if (visible != value)
{
visible = value;
NotifyPropertyChanged("Visible");
}
}
}
bool interactable = true;
///
/// Is item interactable?
///
public bool Interactable
{
get
{
return interactable;
}
set
{
if (interactable != value)
{
interactable = value;
NotifyPropertyChanged("Interactable");
}
}
}
object tag;
///
/// Icon.
///
public object Tag
{
get
{
return tag;
}
set
{
if (tag != value)
{
tag = value;
NotifyPropertyChanged("Tag");
}
}
}
ObservableList