using System; using System.Collections; using System.Collections.Generic; using Ichni.RhythmGame; using TMPro; using UnityEngine; using UnityEngine.Events; namespace Ichni.Editor { public class DynamicUIParameterText : DynamicUIElement, IHaveAutoUpdate { public TMP_Text text; public bool isAutoUpdate { get; set; } public bool isReceiving { get; set; } public override void Initialize(IBaseElement baseElement, string title, string parameterName) { base.Initialize(baseElement, title, parameterName); ApplyContent(); } private void Update() { (this as IHaveAutoUpdate).UpdateContent(); } public void SetAutoUpdate(bool enable) { isAutoUpdate = enable; isReceiving = true; } public void ApplyContent() { text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString(); } public override void AddListenerFunction(UnityAction action) { throw new NotImplementedException(); } } }