chenxin
2020-12-12 75215899d4875545a49c49ee78eff4b8880932f3
Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs
@@ -9,6 +9,7 @@
using TMPro;
using KTGMGemClient;
using DG.Tweening;
using System.Collections;
public class EndlessRandomTower : Singleton<EndlessRandomTower>
{
@@ -57,9 +58,32 @@
    public ParticleSystem btnPS;
    IEnumerator ReadJson()
    {
        while (!GameConfig.JsonReadDone)
        {
            yield return 10;
        }
        countDownLimit = JsonDataCenter.GetById<battle>(23).value;
        Debug.Log("设置了倒计时:" + countDownLimit);
        yield break;
    }
    // Start is called before the first frame update
    void Start()
    {
#if UNITY_ANDROID
#endif
#if UNITY_IPHONE
#endif
#if UNITY_EDITOR
#endif
        StartCoroutine(ReadJson());
        if (!EndlessLevelManager.instanceExists)
            Debug.LogError("[UI] No level manager for tower list");
@@ -86,8 +110,9 @@
    public void UpdateDescDisplay()
    {
        int minLevel = Mathf.Min(EndlessGameUI.instance.MinLevel, 1);
        NormalDesc.text = $"购买{minLevel + 1}级宝石";
        int minLevel = GameConfig.IsUpgradeTowerLevel ? 1 : 0;
        NormalDesc.text = $"购买{minLevel + 1}级精灵";
    }
    public void ChangeBtnClickNormal()
@@ -353,7 +378,9 @@
            gameUI.CancelGhostPlacement();
        if (level == -1)
            level = Mathf.Min(EndlessGameUI.instance.MinLevel, 1);
        {
            level = GameConfig.IsUpgradeTowerLevel ? 1 : 0;
        }
        return gameUI.RandomPlaceTower(tower, posx, posy, level, cost, false, isFirstAppear);
    }