using UnityEngine.UI;

namespace Cryville.Crtr.Browsing {
	public class PVPString : PropertyValuePanel {
		string m_value;
		public override object Value {
			get {
				return m_value;
			}
			set {
				m_value = (string)value;
				_inputField.text = m_value;
			}
		}

		InputField _inputField;

		void Awake() {
			_inputField = GetComponent<InputField>();
			_inputField.onValueChanged.AddListener(OnValueChanged);
		}

		void OnValueChanged(string value) {
			m_value = value;
			Callback(Value);
		}
	}
}
