Implement the new string property value panel.
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user