自动更新型DUI扩展,将Time变量挪出TImeline UI,Effect效果容器修缮,移除Note的transform模块,Scene Camera优化

This commit is contained in:
SoulliesOfficial
2025-02-26 00:52:08 -05:00
parent 1b4637ae95
commit 1e69a44327
36 changed files with 607 additions and 425 deletions

View File

@@ -7,22 +7,32 @@ using UnityEngine;
namespace Ichni.Editor
{
public class DynamicUIParameterText : DynamicUIElement
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);
text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString();
ApplyContent();
}
private void Update()
{
if (isAlwaysUpdated)
{
text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString();
}
(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();
}
}
}