mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 05:37:11 +08:00
(client) feat:添加基地界面到游玩界面的过程,添加存档管理,技能树变得可用 (#58)
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/58
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Entity;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -7,10 +8,21 @@ namespace UI
|
||||
public class CoinCountUI:MonoBehaviour
|
||||
{
|
||||
public TMP_Text text;
|
||||
public int coinCount;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
text.text = coinCount.ToString();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var playerEntity = Program.Instance.FocusedEntity as Character;
|
||||
if (!playerEntity || playerEntity.Coin == null)
|
||||
return;
|
||||
if (coinCount == playerEntity.Coin.Quantity) return;
|
||||
coinCount = playerEntity.Coin.Quantity;
|
||||
text.text = coinCount.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user