| | |
| | | |
| | | // Precalculate inverted grid size, to save a division every time we translate coords |
| | | m_InvGridSize = 1 / gridSize; |
| | | |
| | | SetUpGrid(); |
| | | |
| | | // 初始化格子对应的屏幕坐标数据 延迟执行 |
| | | Invoke("preCalculateGridUIPos", 0.3f); |
| | | //preCalculateGridUIPos(); |
| | | EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessCritBulletNumChange, OnCritBulletNumChange); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 木属性暴击子弹数量改变 |
| | | /// </summary> |
| | | /// <param name="count"></param> |
| | | private void OnCritBulletNumChange(int count) |
| | | { |
| | | for (int i = 0; i < dimensions.x; ++i) |
| | | { |
| | | for (int j = 0; j < AttackRowNumbers; ++j) |
| | | { |
| | | arrTowerBulletUi[i, j].CritBulletNum = count; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (m_arrGridType[ix, y] == PlacementGridType.EGridOpen) |
| | | { |
| | | canPlace = true; |
| | | for (int i = 0; i < allTowerP.Count; i++) |
| | | { |
| | | if (allTowerP[i].x == ix && allTowerP[i].y == y) |
| | | { |
| | | canPlace = false; |
| | | break; |
| | | } |
| | | } |
| | | // for (int i = 0; i < allTowerP.Count; i++) |
| | | // { |
| | | // if (allTowerP[i].x == ix && allTowerP[i].y == y) |
| | | // { |
| | | // canPlace = false; |
| | | // break; |
| | | // } |
| | | // } |
| | | m_Tiles[ix, y].CheckCanPlace(canPlace); |
| | | } |
| | | } |