38 lines
875 B
C#
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;
|
|
}
|
|
}
|
|
} |