| | |
| | | |
| | | // 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> |
| | |
| | | |
| | | arrTowerEnergyEffect[x, y] = Instantiate(energyEffectPrefab); |
| | | arrTowerEnergyEffect[x, y].transform.position = vpos; |
| | | |
| | | |
| | | // 创建水精灵充能条 |
| | | img = Instantiate(FreezeBreathChargePrefab); |
| | | img.transform.SetParent(container.transform); |
| | |
| | | /// <param name="allTowerP"></param> |
| | | public void PlayPS(List<IntVector2> allTowerP) |
| | | { |
| | | for (int i = 0; i < allTowerP.Count; i++) |
| | | { |
| | | m_Tiles[allTowerP[i].x, allTowerP[i].y].SetParticleSystem(true); |
| | | } |
| | | // for (int i = 0; i < allTowerP.Count; i++) |
| | | // { |
| | | // m_Tiles[allTowerP[i].x, allTowerP[i].y].SetParticleSystem(true); |
| | | // } |
| | | } |
| | | /// <summary> |
| | | /// /// 停止所有升级动画 |
| | | /// </summary> |
| | | public void StopPS() |
| | | { |
| | | int iy = dimensions.y - 1;//3 |
| | | for (int ix = 0; ix < dimensions.x; ix++) |
| | | { |
| | | for (int y = iy; y >= dimensions.y - AttackRowNumbers; --y) |
| | | { |
| | | if (m_arrGridType[ix, y] == PlacementGridType.EGridOpen) |
| | | { |
| | | m_Tiles[ix, y].SetParticleSystem(false); |
| | | } |
| | | } |
| | | } |
| | | // int iy = dimensions.y - 1;//3 |
| | | // for (int ix = 0; ix < dimensions.x; ix++) |
| | | // { |
| | | // for (int y = iy; y >= dimensions.y - AttackRowNumbers; --y) |
| | | // { |
| | | // if (m_arrGridType[ix, y] == PlacementGridType.EGridOpen) |
| | | // { |
| | | // m_Tiles[ix, y].SetParticleSystem(false); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | } |
| | | StopPS(); |
| | | //StopPS(); |
| | | } |
| | | |
| | | #if UNITY_EDITOR |