using System.Collections;
|
using System.Collections.Generic;
|
using TableConfig;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
public class PropertyBehaviour : MonoBehaviour
|
{
|
[SerializeField] Text m_PropertyName;
|
[SerializeField] Text m_PropertyValue;
|
|
public void Display(int _property, int _value)
|
{
|
var config = Config.Instance.Get<PlayerPropertyConfig>(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayUpper(int _property, int _value)
|
{
|
var config = Config.Instance.Get<PlayerPropertyConfig>(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayColon(int _property, int _value)
|
{
|
var config = Config.Instance.Get<PlayerPropertyConfig>(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = StringUtility.Contact(config.Name, ":");
|
m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage)),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
}
|
}
|