2025-02-12 00:01:23 -05:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2025-02-12 18:46:46 -05:00
|
|
|
using Ichni.RhythmGame;
|
2025-02-12 00:01:23 -05:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
2025-03-20 02:42:10 -04:00
|
|
|
using UnityEngine.Events;
|
2025-02-12 00:01:23 -05:00
|
|
|
|
|
|
|
|
namespace Ichni.Editor
|
|
|
|
|
{
|
2025-02-26 00:52:08 -05:00
|
|
|
public class DynamicUIParameterText : DynamicUIElement, IHaveAutoUpdate
|
2025-02-12 00:01:23 -05:00
|
|
|
{
|
|
|
|
|
public TMP_Text text;
|
2025-02-26 00:52:08 -05:00
|
|
|
public bool isAutoUpdate { get; set; }
|
|
|
|
|
public bool isReceiving { get; set; }
|
2025-02-12 00:01:23 -05:00
|
|
|
|
2025-02-12 18:46:46 -05:00
|
|
|
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
|
2025-02-12 00:01:23 -05:00
|
|
|
{
|
2025-02-12 18:46:46 -05:00
|
|
|
base.Initialize(baseElement, title, parameterName);
|
2025-02-26 00:52:08 -05:00
|
|
|
ApplyContent();
|
2025-02-12 00:01:23 -05:00
|
|
|
}
|
2025-02-26 00:52:08 -05:00
|
|
|
|
2025-02-12 00:01:23 -05:00
|
|
|
private void Update()
|
|
|
|
|
{
|
2025-02-26 00:52:08 -05:00
|
|
|
(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-02-12 00:01:23 -05:00
|
|
|
}
|
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();
|
|
|
|
|
}
|
2025-02-12 00:01:23 -05:00
|
|
|
}
|
|
|
|
|
}
|