This commit is contained in:
2026-07-15 16:45:12 +08:00
parent 68f86e3f05
commit 4d3e709b6b
8 changed files with 141 additions and 118 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ public class ItemNumShow : MonoBehaviour
private void Awake()
{
GameDispatcher.Instance.AddListener(GameMsg.RefreshItemCount, RefreshItemCount);
// GameDispatcher.Instance.AddListener(GameMsg.RefreshItemCount, RefreshItemCount);
}
private void RefreshItemCount(object obj)
{
+22
View File
@@ -126,6 +126,8 @@ public class ShowScrews : MonoBehaviour, ICanvasRaycastFilter
addHole.onClick.AddListener(OnAddHoleBtnClick);
mergeBox.onClick.AddListener(OnMergeBoxBtnClick);
clearHole.onClick.AddListener(OnClearHoleBtnClick);
GameDispatcher.Instance.AddListener(GameMsg.use_prop, UseProp);
errorBtn.gameObject.SetActive(false);
#if !JarvisRelease
@@ -1759,6 +1761,26 @@ public class ShowScrews : MonoBehaviour, ICanvasRaycastFilter
}
}
public void UseProp(object a)
{
int type = (int)a;
if (type == 0)
{
_requestStageData.item_costs[0]++;
AddHoleLogic();
}
else if (type == 1)
{
_requestStageData.item_costs[1]++;
MergeBoxLogic();
}
else if (type == 2)
{
_requestStageData.item_costs[2]++;
ClearHolesLogic(); //清除孔洞到看不见的缓冲区
}
}
private void AddHoleLogic()
{
_kongLogics[_curUnlockingHoleCount].SetLockState(false);