chenxin
2020-12-25 6baa5a654138a2e0a9871adaef311a74e132dd6e
Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs
@@ -1077,6 +1077,11 @@
                        m_Tiles[x, y] = newTile;
                        newTile.SetTileType(m_arrGridType[x, y]);
                        newTile.SetRender(false, "");//初始化不显示
                        if (m_arrGridType[x, y] == PlacementGridType.EGridWaitBuy)
                        {
                            newTile.SetWarning(true);
                        }
                    }
                }
@@ -1155,9 +1160,18 @@
        /// <param name="y"></param>
        public void CheckCanPlaceUpdate(int x, int y, bool isEmpty, string towerName)
        {
            CloseCanPlace();
            currentCanPlace = m_Tiles[x, y];
            currentCanPlace?.SetRender(true, isEmpty ? towerName : "");
            if (currentCanPlace == null)
            {
                //Debug.Log("第一次");
                currentCanPlace = m_Tiles[x, y];
                currentCanPlace?.SetRender(true, isEmpty ? towerName : "");
            }
            else if (currentCanPlace.GridPosition.x != x || currentCanPlace.GridPosition.y != y)
            {
                CloseCanPlace();
                currentCanPlace = m_Tiles[x, y];
                currentCanPlace?.SetRender(true, isEmpty ? towerName : "");
            }
            // if (isEmpty)
            // {
            //     currentCanPlace.SetTowerVirtualshadow(towerName);
@@ -1169,6 +1183,7 @@
        /// </summary>
        public void CloseCanPlace()
        {
            //Debug.Log("CloseCanPlace:" + currentCanPlace);
            if (currentCanPlace != null)
            {
                currentCanPlace.SetRender(false, "");