UI HUGE UPDATE
This commit is contained in:
@@ -4,16 +4,32 @@ using TMPro;
|
||||
|
||||
public class get_item_prefab : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private bool testColorChange;
|
||||
[SerializeField] private Color defaultItemNameColor = Color.white;
|
||||
public Image item_btm;
|
||||
public Image itemProfile;
|
||||
public TextMeshProUGUI itemAmount;
|
||||
public Text itemName;
|
||||
|
||||
public void Bind(Sprite icon, string displayName, int amount, Color qualityColor)
|
||||
private void Awake()
|
||||
{
|
||||
ApplyItemNameColor(defaultItemNameColor);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!testColorChange)
|
||||
{
|
||||
ApplyItemNameColor(defaultItemNameColor);
|
||||
}
|
||||
}
|
||||
|
||||
public void Bind(Sprite icon, string displayName, int amount, Color qualityColor, Sprite backgroundSprite)
|
||||
{
|
||||
if (item_btm != null)
|
||||
{
|
||||
item_btm.color = qualityColor;
|
||||
item_btm.sprite = backgroundSprite;
|
||||
item_btm.color = backgroundSprite != null ? Color.white : qualityColor;
|
||||
}
|
||||
|
||||
if (itemProfile != null)
|
||||
@@ -28,6 +44,8 @@ public class get_item_prefab : MonoBehaviour
|
||||
itemName.text = displayName ?? string.Empty;
|
||||
}
|
||||
|
||||
ApplyItemNameColor(testColorChange ? qualityColor : defaultItemNameColor);
|
||||
|
||||
if (itemAmount != null)
|
||||
{
|
||||
if (amount <= 1)
|
||||
@@ -40,4 +58,12 @@ public class get_item_prefab : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyItemNameColor(Color color)
|
||||
{
|
||||
if (itemName != null)
|
||||
{
|
||||
itemName.color = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: e7f5efecd257f70488d56bf0a767230c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
testColorChange: 0
|
||||
item_btm: {fileID: 7767232844961157683}
|
||||
itemProfile: {fileID: 514154942639368217}
|
||||
itemAmount: {fileID: 508704441844867492}
|
||||
|
||||
@@ -8,6 +8,9 @@ public class itemGetPrefab : MonoBehaviour
|
||||
public GameObject itemPrefab;
|
||||
public Transform displayParent;
|
||||
|
||||
[Header("rarity")]
|
||||
public ItemRarityColorConfigSO rarityColorConfig;
|
||||
|
||||
[Header("btn")]
|
||||
public Button close;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user