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

44 lines
1.2 KiB
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;
2025-03-20 02:42:10 -04:00
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; }
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);
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();
}
2025-03-20 02:42:10 -04:00
2025-04-14 17:49:47 -04:00
public override DynamicUIElement AddListenerFunction(UnityAction action)
2025-03-20 02:42:10 -04:00
{
throw new NotImplementedException();
}
}
}