Files
SoulliesOfficial 11543b4997 重构inspector!
2025-04-14 17:49:47 -04:00

44 lines
1.2 KiB
C#

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 DynamicUIElement AddListenerFunction(UnityAction action)
{
throw new NotImplementedException();
}
}
}