Implement the new settings browser.

This commit is contained in:
2023-11-11 11:56:36 +08:00
parent 166478e4bb
commit 1803e1dee7
30 changed files with 3775 additions and 459 deletions

View File

@@ -1,5 +1,5 @@
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Cryville.Crtr.Config.UI {
public class PropertyPanel : MonoBehaviour {
@@ -12,18 +12,15 @@ namespace Cryville.Crtr.Config.UI {
[SerializeField]
GameObject m_string;
Text _key;
Transform _valueContainer;
[SerializeField]
TextMeshProUGUI m_key;
[SerializeField]
Transform m_valueContainer;
PropertyValuePanel _value;
#pragma warning disable IDE0051
void Awake() {
_key = transform.Find("Key").GetComponent<Text>();
_valueContainer = transform.Find("Value");
}
#pragma warning restore IDE0051
public void Load(IPropertyAdapter prop) {
_key.text = prop.Name;
m_key.text = prop.Name;
GameObject vp;
switch (prop.Type) {
@@ -33,7 +30,7 @@ namespace Cryville.Crtr.Config.UI {
case PropertyType.String: vp = m_string; break;
default: return;
}
_value = Instantiate(vp, _valueContainer, false).GetComponent<PropertyValuePanel>();
_value = Instantiate(vp, m_valueContainer, false).GetComponent<PropertyValuePanel>();
_value.Init(prop);
}
}