wangguan
2020-12-02 6bc45c691891dac88bece3483fb6f3cf2d7a00a4
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -127,11 +127,19 @@
        public TextMoveDoTween bloodCrit;
        /// <summary>
        /// 减速飘字
        /// </summary>
        public Image SlowDownWord;
        /// <summary>
        /// 暴击飘字
        /// </summary>
        public Image CritWord;
        /// <summary>
        /// 购买塔防按钮上的Text.
        /// </summary>
        protected TextMeshProUGUI towerPriceText;
        //protected TextMeshProUGUI towerPriceText1;
        protected bool tdBuyDisable = false;
@@ -2021,6 +2029,28 @@
            }
        }
        /// <summary>
        /// 减速飘字
        /// </summary>
        public void FloatSlowDownWord(Vector3 worldPos)
        {
            Vector3 screenPos = m_Camera.WorldToScreenPoint(worldPos);
            GameObject obj = Instantiate(SlowDownWord.gameObject);
            obj.GetComponent<Transform>().SetParent(GameObject.Find("MainUI/TextPanel").GetComponent<Transform>(), false);
            obj.GetComponent<TextMoveDoTween>().FloatSlowDownWord(screenPos.x, screenPos.y);
        }
        /// <summary>
        /// 暴击飘字
        /// </summary>
        public void FloatCritWord(Vector3 worldPos)
        {
            Vector3 screenPos = m_Camera.WorldToScreenPoint(worldPos);
            GameObject obj = Instantiate(CritWord.gameObject);
            obj.GetComponent<Transform>().SetParent(GameObject.Find("MainUI/TextPanel").GetComponent<Transform>(), false);
            obj.GetComponent<TextMoveDoTween>().FloatCritWord(screenPos.x, screenPos.y);
        }
        private void Start()
        {
            // 获取相应的放置区域。