| | |
| | | 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() |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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); |