feat(Connect): 完成连线基本玩法,
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user