wangguan
2020-11-11 68f3da2cc3b2435ceacb7ced5d0107c10ee2b361
Assets/Scripts/TowerDefense/Towers/Tower.cs
@@ -193,10 +193,13 @@
        /// 播放充能状态特效.
        /// </summary>
        /// <param name="play"></param>
        public void PlayEnergyEffect(bool play)
        public void PlayEnergyEffect(bool play, bool isClose = true)
        {
            if (this.energyCtl)
            if (this.energyCtl && isClose)
                energyCtl.gameObject.SetActive(!play);
            else if(!isClose){
            }
            if (!opponentSide)
            {
@@ -365,6 +368,42 @@
        }
        /// <summary>
        /// This function is called when the object becomes enabled and active.
        /// </summary>
        void OnEnable()
        {
            // if (bulletCtl != null)
            // {
            //     Debug.Log("打开了bulletCtl");
            //     bulletCtl.gameObject.SetActive(true);
            // }
            // if (energyCtl != null)
            // {
            //     Debug.Log("打开了energyCtl");
            //     energyCtl.gameObject.SetActive(true);
            // }
        }
        /// <summary>
        /// This function is called when the behaviour becomes disabled or inactive.
        /// </summary>
        void OnDisable()
        {
            if (bulletCtl != null)
            {
                bulletCtl.gameObject.SetActive(false);
            }
            if (energyCtl != null)
            {
                energyCtl.gameObject.SetActive(false);
            }
        }
        /// <summary>
        /// 初始化当前塔防的局内升级,lvl从1开始.
        /// </summary>
        /// <param name="lvl"></param>
@@ -515,7 +554,8 @@
            StartCoroutine(ResetScale());
        }
        IEnumerator ResetScale(){
        IEnumerator ResetScale()
        {
            yield return new WaitForSeconds(0.2f);
            if (gridPosition.y > 1)
            {