| | |
| | | SetUpGrid(); |
| | | |
| | | // 初始化格子对应的屏幕坐标数据 延迟执行 |
| | | Invoke("preCalculateGridUIPos",0.3f); |
| | | Invoke("preCalculateGridUIPos", 0.3f); |
| | | //preCalculateGridUIPos(); |
| | | } |
| | | |
| | |
| | | |
| | | Vector3 pos = buyButton.transform.position; |
| | | pos.x = arrGridCentPos[x, y].x; |
| | | pos.z = arrGridCentPos[x, y].y + (y - AttackRowNumbers) * 1.9f; |
| | | pos.z = arrGridCentPos[x, y].y; |
| | | pos.y = 30; |
| | | buyButton.transform.position = pos; |
| | | buyButton.transform.localRotation = Quaternion.identity; |
| | |
| | | m_arrTowerBulletUIPos[x, y].x = arrGridCentPos[x, dy - y].x; |
| | | m_arrTowerBulletUIPos[x, y].y = arrGridCentPos[x, dy - y].y; |
| | | |
| | | // 现在PVE基地不需要血条 |
| | | GameObject img = Instantiate(towerBloodUIPrefab); |
| | | GameObject container = GameObject.Find("BuyButtonContainer"); |
| | | img.transform.SetParent(container.transform); |
| | |
| | | img.transform.SetParent(container.transform, true); |
| | | tpos = img.transform.position; |
| | | tpos.x = m_arrTowerBulletUIPos[x, y].x + 4.2f; |
| | | tpos.z = m_arrTowerBulletUIPos[x, y].y + 1.1f - y * 1.66f; |
| | | tpos.z = m_arrTowerBulletUIPos[x, y].y - 0.5f; |
| | | tpos.y = 30f; |
| | | img.transform.position = tpos; |
| | | img.transform.localScale = Vector3.one; |
| | |
| | | img.transform.SetParent(container.transform); |
| | | tpos = img.transform.position; |
| | | tpos.x = m_arrTowerBulletUIPos[x, y].x + 4.2f; |
| | | tpos.z = m_arrTowerBulletUIPos[x, y].y + 1.1f - y * 1.66f; |
| | | tpos.z = m_arrTowerBulletUIPos[x, y].y - 0.5f; |
| | | tpos.y = 30f; |
| | | img.transform.position = tpos; |
| | | img.transform.localScale = Vector3.one; |