Implement the new string property value panel.

This commit is contained in:
2023-11-30 21:27:30 +08:00
parent c55a5d7ddd
commit f9916cbce7
4 changed files with 593 additions and 11 deletions

View File

@@ -1,18 +1,15 @@
using UnityEngine.UI;
using TMPro;
using UnityEngine;
namespace Cryville.Crtr.Config.UI {
public class PVPString : PropertyValuePanel {
protected override void OnValueUpdated() { _inputField.text = (string)MappedValue; }
InputField _inputField;
[SerializeField]
TMP_InputField m_inputField;
void Awake() {
_inputField = GetComponent<InputField>();
_inputField.onValueChanged.AddListener(OnValueChanged);
}
void OnValueChanged(string value) {
RawValue = value;
m_inputField.onValueChanged.AddListener(OnValueChanged);
}
protected override void OnValueUpdated() { m_inputField.text = (string)MappedValue; }
void OnValueChanged(string value) { RawValue = value; }
}
}