This commit is contained in:
2026-07-17 11:04:14 +08:00
parent 544f4b2d01
commit 25f3b9e1ab
27 changed files with 448 additions and 582 deletions
+27 -10
View File
@@ -126,17 +126,19 @@ 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
errorBtn.gameObject.SetActive(true);
if (errorBtn == null) return;
// #if !JarvisRelease
// errorBtn.gameObject.SetActive(true);
// if (errorBtn == null) return;
errorBtn.onClick.AddListener(() =>
{
GameHelper.SendErrorToServer("TestError 001", LogType.Error.ToString());
});
#endif
// errorBtn.onClick.AddListener(() =>
// {
// GameHelper.SendErrorToServer("TestError 001", LogType.Error.ToString());
// });
// #endif
}
@@ -1759,9 +1761,24 @@ public class ShowScrews : MonoBehaviour, ICanvasRaycastFilter
}
}
public void UseProp()
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()