using UnityEngine.UI;
namespace UnityEngine.Rendering.UI
{
///
/// DebugUIHandler for object widget.
///
public class DebugUIHandlerObject : DebugUIHandlerWidget
{
/// Name of the value field.
public Text nameLabel;
/// Value of the value field.
public Text valueLabel;
internal override void SetWidget(DebugUI.Widget widget)
{
base.SetWidget(widget);
var field = CastWidget();
nameLabel.text = field.displayName;
valueLabel.text = field.GetValue().name;
}
///
/// OnSelection implementation.
///
/// True if the selection wrapped around.
/// Previous widget.
/// True if the selection is allowed.
public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous)
{
nameLabel.color = colorSelected;
valueLabel.color = colorSelected;
return true;
}
///
/// OnDeselection implementation.
///
public override void OnDeselection()
{
nameLabel.color = colorDefault;
valueLabel.color = colorDefault;
}
}
}