Files
aibis-dream/Assets/Scripts/UI/Panel/RecordPanel.cs
T
dingyuntian 9f20ef52d8 UI工具翻新
1. 增加UI工具
2. 增加设置页面
3. GameLoop更新
4. 导入ActionKit工具
2025-04-21 18:53:30 +08:00

38 lines
875 B
C#

using System.Text;
using TMPro;
using UnityEngine;
namespace AibisDream
{
public class RecordPanel : MonoBehaviour, IUIPanel
{
public bool IsOpen => gameObject.activeSelf;
public readonly StringBuilder recordStr = new();
public void Show()
{
ShowText();
gameObject.SetActive(true);
}
public void Hide()
{
gameObject.SetActive(false);
// 关闭时停止渲染
ClearText();
}
private void ShowText()
{
var text = transform.Find("Log View").GetComponentInChildren<TMP_Text>();
text.text = recordStr.ToString();
}
private void ClearText()
{
var text = transform.Find("Log View").GetComponentInChildren<TMP_Text>();
text.text = null;
}
}
}