装备系统完结,修复并加入很多
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class bagItemPreviewPrefab : MonoBehaviour
|
||||
{
|
||||
public Image btm_img;
|
||||
public Image profileImage;
|
||||
public Text itemName;
|
||||
public Text itemToUsing;
|
||||
public Text itemDescription;
|
||||
public TextMeshProUGUI itemAmount;
|
||||
|
||||
public void Bind(Color backgroundColor, Sprite icon, string displayName, string usage, string description, string amountText)
|
||||
{
|
||||
if (btm_img != null)
|
||||
{
|
||||
btm_img.color = backgroundColor;
|
||||
}
|
||||
|
||||
if (profileImage != null)
|
||||
{
|
||||
profileImage.sprite = icon;
|
||||
profileImage.enabled = icon != null;
|
||||
profileImage.color = Color.white;
|
||||
}
|
||||
|
||||
if (itemName != null)
|
||||
{
|
||||
itemName.text = displayName ?? string.Empty;
|
||||
}
|
||||
|
||||
if (itemToUsing != null)
|
||||
{
|
||||
itemToUsing.text = usage ?? string.Empty;
|
||||
}
|
||||
|
||||
if (itemDescription != null)
|
||||
{
|
||||
itemDescription.text = description ?? string.Empty;
|
||||
}
|
||||
|
||||
if (itemAmount != null)
|
||||
{
|
||||
itemAmount.text = amountText ?? string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user