From 80062eeaedc5a52bdb6ede8852fc13d2cd9da688 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 02 一月 2026 00:35:22 +0800
Subject: [PATCH] 0312 修复马匹爆炸位置不对的问题
---
Main/System/BeautyMM/BeautyMMTravelWin.cs | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/Main/System/BeautyMM/BeautyMMTravelWin.cs b/Main/System/BeautyMM/BeautyMMTravelWin.cs
index b2bbaa4..aaf6dab 100644
--- a/Main/System/BeautyMM/BeautyMMTravelWin.cs
+++ b/Main/System/BeautyMM/BeautyMMTravelWin.cs
@@ -40,6 +40,13 @@
DisplyRate();
buildResultBtn.AddListener(BuildLVUP);
+
+
+ var parentRect = girdsGo.GetComponent<RectTransform>();
+ var parentWidth = parentRect.rect.width;
+ var parentHeight = parentRect.rect.height;
+ gridWidth = parentWidth / BeautyMMManager.Instance.travelRowCol[1];
+ gridHeight = parentHeight / BeautyMMManager.Instance.travelRowCol[0];
}
protected override void OnPreOpen()
@@ -74,7 +81,7 @@
boomRowEffect.transform.localPosition = new Vector3(0,
height/2-((BeautyMMManager.Instance.clickGirdPos.x - 1) * gridHeight + gridHeight / 2), 0);
boomRowEffect.Play();
- boomColEffect.transform.localPosition = new Vector3(((BeautyMMManager.Instance.clickGirdPos.y - 1) * gridWidth + gridWidth / 2) - width/2, 0, 0);
+ boomColEffect.transform.localPosition = new Vector3((BeautyMMManager.Instance.clickGirdPos.y - 1) * gridWidth + gridWidth / 2 - width/2, 0, 0);
boomColEffect.Play();
}
@@ -121,15 +128,7 @@
if (i == showIndex && !hasDoor)
{
buildImgs[i].SetActive(true);
- //鏍规嵁鐖剁粍浠剁殑瀹介珮锛屽拰鏍煎瓙鍧愭爣璁$畻璧风偣鍧愭爣
- if (gridWidth == 0 || gridHeight == 0)
- {
- var parentRect = buildImgs[i].transform.parent.GetComponent<RectTransform>();
- var parentWidth = parentRect.rect.width;
- var parentHeight = parentRect.rect.height;
- gridWidth = parentWidth / BeautyMMManager.Instance.travelRowCol[1];
- gridHeight = parentHeight / BeautyMMManager.Instance.travelRowCol[0];
- }
+
var x = (BeautyMMManager.Instance.m_SceneryCol - 1) * gridWidth + 2;
var y = (BeautyMMManager.Instance.m_SceneryRow - 1) * gridHeight + 2;
buildImgs[i].transform.localPosition = new Vector3(x, -y, 0);
--
Gitblit v1.8.0