chenxin
2020-11-17 40b918d5189a154bc0ff31627e69867742934720
Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs
@@ -589,12 +589,25 @@
            // 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>
@@ -774,7 +787,7 @@
                    arrTowerEnergyEffect[x, y] = Instantiate(energyEffectPrefab);
                    arrTowerEnergyEffect[x, y].transform.position = vpos;
                    // 创建水精灵充能条
                    img = Instantiate(FreezeBreathChargePrefab);
                    img.transform.SetParent(container.transform);
@@ -1033,27 +1046,27 @@
        /// <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>
@@ -1100,7 +1113,7 @@
                    }
                }
            }
            StopPS();
            //StopPS();
        }
#if UNITY_EDITOR