feat(Connect): 完成连线基本玩法,

This commit is contained in:
2025-10-19 19:38:52 +08:00
parent e14e8925de
commit f3d73ab65a
34 changed files with 2528 additions and 988 deletions

View File

@@ -1,6 +1,7 @@
using System;
using Core;
using Gameplay.Player;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
@@ -9,7 +10,7 @@ namespace UI
public class PlayerHpViewer : UIBase
{
private PlayerController _playerController;
public Text hpText;
public TMP_Text hpText;
private void Awake()
{
@@ -20,11 +21,12 @@ namespace UI
{
_playerController = playerController;
_playerController.OnHealthChanged += UpdateHpText;
UpdateHpText(_playerController.CurrentHealth);
}
private void UpdateHpText(int currentHealth)
{
hpText.text = "HP: " + currentHealth;
hpText.text = "HP: " + currentHealth.ToString();
}
private void OnDestroy()