| | |
| | | private string iconPath = "UI/Endless/BuffIcon/"; |
| | | |
| | | private string qualityPath = "UI/Endless/BuffQuality/"; |
| | | public ParticleSystem myPS;//播放粒子特效 |
| | | GameObject psParent; |
| | | |
| | | public BuffFly buffFly;//确定后的飞动脚本 |
| | | private void Start() |
| | | { |
| | | |
| | | if (psParent == null && myPS != null) |
| | | { |
| | | psParent = myPS.transform.parent.gameObject; |
| | | } |
| | | } |
| | | |
| | | public void OnClick() |
| | | { |
| | | AudioSourceManager.Ins.Play(AudioEnum.ChooseBuff); |
| | | //判断是否是金钱 |
| | | if (isGold) |
| | | { |
| | | AudioSourceManager.Ins.Play(AudioEnum.Gold); |
| | | } |
| | | else |
| | | { |
| | | AudioSourceManager.Ins.Play(AudioEnum.UI); |
| | | } |
| | | |
| | | if (OnSelectBuffCompleted != null) |
| | | 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) |
| | |
| | | Name.color = EndlessBuffData.GetColorByRare(rare); |
| | | } |
| | | |
| | | bool isGold;//是否是金币BUFF |
| | | public void SetIsGold(bool isGold) |
| | | { |
| | | this.isGold = isGold; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置选中状态,做个缓动播放粒子特效 |
| | | /// </summary> |
| | |
| | | BorderImage.gameObject.SetActive(selected); |
| | | |
| | | if (selected) |
| | | { |
| | | DOTween.To(() => transform.localScale, (v) => transform.localScale = v, new Vector3(1f, 1f, 1f), 0.15f); |
| | | if (!psParent.activeSelf) psParent.SetActive(true); |
| | | myPS?.Play(); |
| | | } |
| | | else |
| | | { |
| | | DOTween.To(() => transform.localScale, (v) => transform.localScale = v, new Vector3(0.87f, 0.87f, 0.87f), 0.15f); |
| | | myPS?.Stop(); |
| | | if (psParent.activeSelf) psParent.SetActive(false); |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |