自动更新型DUI扩展,将Time变量挪出TImeline UI,Effect效果容器修缮,移除Note的transform模块,Scene Camera优化
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user