chenxin
2020-12-12 8b627d3742f14314736ac865e3f71b92877424ca
Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs
@@ -60,6 +60,8 @@
    // Start is called before the first frame update
    void Start()
    {
        countDownLimit = JsonDataCenter.GetById<battle>(23).value;
        //Debug.Log("设置了倒计时:" + countDownLimit);
        if (!EndlessLevelManager.instanceExists)
            Debug.LogError("[UI] No level manager for tower list");
@@ -86,10 +88,7 @@
    public void UpdateDescDisplay()
    {
        int minLevel = 0;
        if (EndlessUIStart.instance.GameStartTime >= JsonDataCenter.DOUBLE_GEM_TIME)
            minLevel = Mathf.Min(EndlessGameUI.instance.MinLevel, 1);
        int minLevel = GameConfig.IsUpgradeTowerLevel ? 1 : 0;
        NormalDesc.text = $"购买{minLevel + 1}级宝石";
    }
@@ -288,7 +287,6 @@
        if (isCountStartDown)
        {
            countDownTime += Time.deltaTime;
            //Debug.Log("倒计时中");
            if (countDownTime > countDownLimit)
            {
@@ -313,12 +311,24 @@
        if (current >= result && num < 10)//自己的钱多
        {
            //Debug.Log($"当前金币 :{current}  下一次购买需要金币:{result}  塔的数量:{num}");
            isCountStartDown = false;
            needClickPS.Play();
        }
    }
    public void CheckMoney()
    {
        int result;
        int.TryParse(cashText.text.ToString(), out result);
        int current = EndlessLevelManager.instance.Currency.currentCurrency;
        if (current < result && needClickPS.isPlaying)//自己的钱多
        {
            needClickPS.Stop();
            isCountStartDown = true;
            countDownTime = 0;
        }
    }
    private void CheckCurrencyEnough()
    {
@@ -345,15 +355,9 @@
        if (gameUI.isBuilding)
            gameUI.CancelGhostPlacement();
        if (EndlessUIStart.instance.GameStartTime >= JsonDataCenter.DOUBLE_GEM_TIME)
        if (level == -1)
        {
            if (level == -1)
                level = Mathf.Min(EndlessGameUI.instance.MinLevel, 1);
        }
        else
        {
            if (level == -1)
                level = 0;
            level = GameConfig.IsUpgradeTowerLevel ? 1 : 0;
        }
        return gameUI.RandomPlaceTower(tower, posx, posy, level, cost, false, isFirstAppear);