mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 06:47:14 +08:00
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/60
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using Base;
|
|
using Managers;
|
|
using TMPro;
|
|
|
|
namespace UI
|
|
{
|
|
public class InformationUI : UIBase, ITick
|
|
{
|
|
public TMP_Text entityInformation;
|
|
public TMP_Text dimensionInformation;
|
|
|
|
public void Tick()
|
|
{
|
|
var focus = Program.Instance.FocusedEntity;
|
|
if (focus)
|
|
{
|
|
var text = $"定义: {focus.entityDef.defName}\n" +
|
|
$"派系: {focus.affiliation}\n" +
|
|
$"属性: {focus.AttributesNow}\n" +
|
|
$"状态:{focus.CurrentState}\n" +
|
|
$"朝向:{focus.CurrentOrientation}\n";
|
|
entityInformation.text = text;
|
|
}
|
|
|
|
var focusDim = Program.Instance.FocusedDimension;
|
|
if (focusDim)
|
|
dimensionInformation.text =
|
|
$"定义:{focusDim.dimensionDefinition.defName}\n" +
|
|
$"实体总数:{EntityManager.Instance.GetAllEntities(focusDim.DimensionId).Length}";
|
|
}
|
|
|
|
public override void Show()
|
|
{
|
|
base.Show();
|
|
Clock.AddTick(this);
|
|
}
|
|
|
|
public override void Hide()
|
|
{
|
|
base.Hide();
|
|
Clock.RemoveTick(this);
|
|
}
|
|
}
|
|
} |