using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class TipSpiritWeaponPropertyWidget : MonoBehaviour
|
{
|
[SerializeField] Text m_PropertyBehaviour;
|
|
public void Display(ItemTipUtility.SpiritWeaponProperty data)
|
{
|
var itemConfig = ItemConfig.Get(data.itemId);
|
var count = data.properties.Count + (itemConfig.EquipPlace == 14 ? 1 : 0);
|
var lines = new string[count];
|
var lineIndex = 0;
|
foreach (var property in data.properties)
|
{
|
var config = PlayerPropertyConfig.Get(property.x);
|
var name = config.Name;
|
|
var value = (property.x == 79 || property.x == 80) ?
|
ItemLogicUtility.Instance.GetSpecialSpiritPropertyValue(data.itemId) : property.y;
|
|
var valueDescription = string.Empty;
|
var maxLevel = ItemLogicUtility.Instance.GetSpecialSpiritPropertyMaxLevel(data.itemId);
|
switch (property.x)
|
{
|
case 79:
|
valueDescription = UIHelper.ReplaceNewLine(Language.Get("EquipTip_ExtraDamage", value, maxLevel, property.y));
|
lines[lineIndex++] = UIHelper.AppendColor(property.z, valueDescription);
|
break;
|
case 80:
|
valueDescription = UIHelper.ReplaceNewLine(Language.Get("EquipTip_ExtraHpBack", value, maxLevel, property.y));
|
lines[lineIndex++] = UIHelper.AppendColor(property.z, valueDescription);
|
break;
|
default:
|
valueDescription = PlayerPropertyConfig.GetValueDescription(property.x, value);
|
lines[lineIndex++] = UIHelper.AppendColor(property.z, string.Format("{0}: {1}", name, valueDescription));
|
break;
|
}
|
}
|
|
switch (itemConfig.EquipPlace)
|
{
|
case 13:
|
break;
|
case 14:
|
lines[lineIndex] = UIHelper.ReplaceNewLine(Language.Get("Automatic_Picking"));
|
break;
|
case 16:
|
break;
|
case 17:
|
break;
|
}
|
|
m_PropertyBehaviour.text = string.Join("\r\n", lines);
|
}
|
|
}
|
}
|