From 23c416e43615b956f9b685b2184e9b18bf9cb665 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 31 十月 2025 00:01:58 +0800
Subject: [PATCH] 81 子 【常规】背包 / 【常规】背包-客户端
---
Main/System/KnapSack/Logic/ComposeGirdCell.cs | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/Main/System/KnapSack/Logic/ComposeGirdCell.cs b/Main/System/KnapSack/Logic/ComposeGirdCell.cs
index 3ee472c..4827c80 100644
--- a/Main/System/KnapSack/Logic/ComposeGirdCell.cs
+++ b/Main/System/KnapSack/Logic/ComposeGirdCell.cs
@@ -10,16 +10,43 @@
[SerializeField] Image fillImage;
[SerializeField] Image fullImage;
[SerializeField] Text processText;
+ [SerializeField] Image redImg;
public void Display(int index)
{
+ if (index >= PackManager.Instance.composeItemGuidList.Count)
+ {
+ return;
+ }
var guid = PackManager.Instance.composeItemGuidList[index];
var item = PackManager.Instance.GetItemByGuid(guid);
if (item == null)
return;
itemCell.Init(item);
- itemCell.button.AddListener(()=>
+ itemCell.button.AddListener(() =>
{
//鍚堟垚鐣岄潰
+ ComposeWin.guid = guid;
+ UIManager.Instance.OpenWindow<ComposeWin>();
});
+
+ var config = ItemCompoundConfig.GetItemCompoundConfig(item.itemId);
+ var targetID = config.itemID;
+ var targetCnt = config.itemCount;
+ var haveCnt = PackManager.Instance.GetItemCountByID(PackType.Item, targetID);
+ if (haveCnt >= targetCnt)
+ {
+ fullImage.SetActive(true);
+ fillImage.SetActive(false);
+ redImg.SetActive(true);
+ }
+ else
+ {
+ fullImage.SetActive(false);
+ fillImage.SetActive(true);
+ redImg.SetActive(false);
+ fillImage.fillAmount = haveCnt / (float)targetCnt;
+ }
+ processText.text = haveCnt+ "/" + targetCnt;
+
}
}
--
Gitblit v1.8.0