You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/StompyRobot/SRDebugger/Scripts/UI/Controls/Data/ReadOnlyControl.cs

37 lines
818 B
C#

namespace SRDebugger.UI.Controls.Data
{
using System;
using SRF;
using UnityEngine.UI;
public class ReadOnlyControl : DataBoundControl
{
[RequiredField]
public Text ValueText;
[RequiredField]
public Text Title;
protected override void Start()
{
base.Start();
}
protected override void OnBind(string propertyName, Type t)
{
base.OnBind(propertyName, t);
Title.text = propertyName;
}
protected override void OnValueUpdated(object newValue)
{
ValueText.text = Convert.ToString(newValue);
}
public override bool CanBind(Type type, bool isReadOnly)
{
return type == typeof(string) && isReadOnly;
}
}
}