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; }
}
}

View File

@@ -267,7 +267,7 @@ MonoBehaviour:
m_number: {fileID: 1880403085839712, guid: ff4163f524bb55448a401088bfa55b9b, type: 3}
m_numberStepped: {fileID: 1880403085839712, guid: a09ad1d928e6820478bd99830568b293,
type: 3}
m_string: {fileID: 7940274472347270489, guid: d3142009b74dda042a75e9b808dde66d,
m_string: {fileID: 7940274472347270489, guid: 0b5e0902fbdd44e489152b99d6ad87cd,
type: 3}
m_key: {fileID: 4802398658257034679}
m_valueContainer: {fileID: 22451436}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0b5e0902fbdd44e489152b99d6ad87cd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: