27 lines
937 B
C#
27 lines
937 B
C#
using Continentis.MainGame.Character;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.MainGame.UI
|
|
{
|
|
public class CombatResourceIcon : UIElementBase
|
|
{
|
|
public string currentAttributeName;
|
|
public string maximumAttributeName;
|
|
public TMP_Text resourceText;
|
|
|
|
public void Initialize(string currentAttributeName, string maximumAttributeName)
|
|
{
|
|
this.currentAttributeName = currentAttributeName;
|
|
this.maximumAttributeName = maximumAttributeName;
|
|
}
|
|
|
|
public void SetInfoText(CharacterBase character)
|
|
{
|
|
int currentValue = character.attributeSubmodule.GetGeneralAttribute(currentAttributeName);
|
|
int maximumValue = character.attributeSubmodule.GetGeneralAttribute(maximumAttributeName);
|
|
string displayText = currentValue + "/" + maximumValue;
|
|
resourceText.text = displayText;
|
|
}
|
|
}
|
|
} |