Files
ichni_Creator_Studio/Assets/Scripts/DynamicUI/DynamicUIElements/Simple/DynamicUIText.cs

28 lines
831 B
C#
Raw Normal View History

using System;
using System.Collections;
using System.Collections.Generic;
2025-02-12 18:46:46 -05:00
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
namespace Ichni.Editor
{
public class DynamicUIText : DynamicUIElement
{
public TMP_Text text;
2025-02-12 18:46:46 -05:00
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
{
2025-02-12 18:46:46 -05:00
base.Initialize(baseElement, title, parameterName);
text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString();
}
private void Update()
{
if (isAlwaysUpdated)
{
2025-02-12 18:46:46 -05:00
text.text = connectedBaseElement.GetType().GetField(parameterName).GetValue(connectedBaseElement).ToString();
}
}
}
}