38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |