chenxin
2020-12-11 80e661fd703af3f305efadf02f31c014b9f79d90
Assets/Scripts/TowerDefense/UI/HUD/SelectBuffIcon.cs
@@ -53,6 +53,8 @@
        private string qualityPath = "UI/Endless/BuffQuality/";
        public ParticleSystem myPS;//播放粒子特效
        GameObject psParent;
        public BuffFly buffFly;//确定后的飞动脚本
        private void Start()
        {
            if (psParent == null && myPS != null)
@@ -77,6 +79,20 @@
                OnSelectBuffCompleted(Index);
        }
        public void Fly()
        {
            if (buffFly != null)
            {
                buffFly.SetIcon(Icon.sprite);
                buffFly.SetQuality(QualityImage.sprite);
                buffFly.SetName(Name.text);
                buffFly.SetEffect(Effect.text);
                buffFly.SetRare(Name.color);
                buffFly.Fly();
            }
        }
        public void SetIcon(int resId)
        {
            Icon.sprite = Resources.Load($"{iconPath}{resId}", typeof(Sprite)) as Sprite;