프로젝트 Common 스크립트 추가
This commit is contained in:
35
Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs
Normal file
35
Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class IngameUI : UIBase
|
||||
{
|
||||
public static IngameUI Instance => UIManager.Singleton.GetUI<IngameUI>(UIList.IngameUI);
|
||||
|
||||
public Image hpBar;
|
||||
public Image spBar;
|
||||
|
||||
public TextMeshProUGUI hpText;
|
||||
public TextMeshProUGUI spText;
|
||||
|
||||
public void SetHP(float current, float max)
|
||||
{
|
||||
hpBar.fillAmount = current / max;
|
||||
hpText.text = $"{current:0} / {max: 0}";
|
||||
}
|
||||
|
||||
public void SetSP(float current, float max)
|
||||
{
|
||||
spBar.fillAmount = current / max;
|
||||
spText.text = $"{current:0} / {max: 0}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user