using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
[XLua.Hotfix]
|
public class PropertyBehaviour : MonoBehaviour
|
{
|
[SerializeField] Text m_PropertyName;
|
[SerializeField] Text m_PropertyValue;
|
[SerializeField] Text m_PropertyAdd;
|
|
public void Display(int _property, int _value)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact(
|
UIHelper.ReplaceLargeNum(UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayUpper(int _property, int _value)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayColon(int _property, int _value)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = StringUtility.Contact(config.Name, ":");
|
m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayAdd(int _property, int _value, int _add)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = StringUtility.Contact(config.Name, ":");
|
m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
if (_add == 0)
|
{
|
m_PropertyAdd.text = string.Empty;
|
}
|
else
|
{
|
m_PropertyAdd.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
}
|
|
public void DisplayGodWeaponAdd(int _property, int _value, int _add)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
if (_add == 0)
|
{
|
m_PropertyAdd.text = string.Empty;
|
}
|
else
|
{
|
m_PropertyAdd.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
}
|
|
public void DisplayCompare(int _property, int _value, int _add)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
m_PropertyAdd.text = StringUtility.Contact(UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
|
public void DisplayUp(int _property, int _value, int _add)
|
{
|
var config = PlayerPropertyConfig.Get(_property);
|
if (config != null)
|
{
|
m_PropertyName.text = config.Name;
|
m_PropertyValue.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_value, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
if (_add == 0)
|
{
|
m_PropertyAdd.text = string.Empty;
|
}
|
else
|
{
|
m_PropertyAdd.text = StringUtility.Contact("+", UIHelper.ReplaceLargeNum(
|
UIHelper.ReplacePercentage(_add, config.ISPercentage, UIHelper.GetPropertyDecimalCount(_property))),
|
config.ISPercentage == 1 ? "%" : string.Empty);
|
}
|
}
|
}
|
}
|
}
|