chenxin
2020-11-24 5caa573ce573fa0427845b2224b3a6005781e80e
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -1363,9 +1363,7 @@
                return false;
            }
            BuyTower(pointer, force, zeroCost);
            return true;
            return BuyTower(pointer, force, zeroCost);
        }
        /// <summary>
@@ -1573,9 +1571,9 @@
        /// Throws exception when not in a build mode or when tower is not a valid position
        /// </exception>
        /// </summary>
        public void BuyTower(UIPointer pointer, bool force = false, bool zeroCost = false)
        public bool BuyTower(UIPointer pointer, bool force = false, bool zeroCost = false)
        {
            if (!isBuilding) return;
            if (!isBuilding) return false;
            // 判断是否格子上重复放置塔防
            if (!m_CurrentTower || !IsGhostAtValidPosition())
@@ -1607,11 +1605,11 @@
                    if (!pointer.raycast.HasValue || pointer.raycast.Value.collider == null)
                    {
                        CancelGhostPlacement();
                        return;
                        return false;
                    }
                    PlaceGhost(pointer);
                }
                return;
                return true;
            }
            // 这是判断是否超出了格子
@@ -1619,7 +1617,7 @@
            if (!pointer.raycast.HasValue || pointer.raycast.Value.collider == null)
            {
                CancelGhostPlacement();
                return;
                return false;
            }
            int cost = m_CurrentTower.controller.purchaseCost;
@@ -1630,6 +1628,8 @@
            {
                PlaceGhost(pointer);
            }
            return true;
        }
        /// <summary>