| | |
| | | |
| | | [SerializeField]public Image imgIcon; |
| | | |
| | | [SerializeField]public Image imgSkillName; |
| | | |
| | | [SerializeField] public GradientText txtSkillName; |
| | | [SerializeField] public CanvasGroup canvasGroup; |
| | | [SerializeField] public Image imageBg; |
| | | |
| | | private Tween tween1; |
| | |
| | | KillAllTweens(); |
| | | |
| | | imgIcon.sprite = UILoader.LoadSprite("HeroHead", teamHero.skinConfig.SquareIcon); |
| | | imgSkillName.sprite = UILoader.LoadSprite("SkillNameIcon", skillConfig.SkillTipsName); |
| | | imgSkillName.SetNativeSize(); |
| | | txtSkillName.text = skillConfig.SkillName; |
| | | |
| | | // 保证开始时所有图片为可见(alpha=1) |
| | | if (imageBg != null) { var c = imageBg.color; c.a = 1f; imageBg.color = c; } |
| | | if (imgIcon != null) { var c = imgIcon.color; c.a = 1f; imgIcon.color = c; } |
| | | if (imgSkillName != null) { var c = imgSkillName.color; c.a = 1f; imgSkillName.color = c; } |
| | | if (canvasGroup != null) { var c = canvasGroup.alpha; c = 1f; canvasGroup.alpha = c; } |
| | | |
| | | gameObject.SetActive(true); |
| | | float posY = transform.localPosition.y; |
| | |
| | | seq.Join(imageBg.DOFade(0f, fadeDuration).SetEase(Ease.InQuad)); |
| | | if (imgIcon != null) |
| | | seq.Join(imgIcon.DOFade(0f, fadeDuration).SetEase(Ease.InQuad)); |
| | | if (imgSkillName != null) |
| | | seq.Join(imgSkillName.DOFade(0f, fadeDuration).SetEase(Ease.InQuad)); |
| | | if (canvasGroup != null) |
| | | seq.Join(canvasGroup.DOFade(0f, fadeDuration).SetEase(Ease.InQuad)); |
| | | |
| | | seq.OnComplete(() => |
| | | { |
| | |
| | | // 恢复图片 alpha,保证下次显示时可见 |
| | | if (imageBg != null) { var cc = imageBg.color; cc.a = 1f; imageBg.color = cc; } |
| | | if (imgIcon != null) { var cc = imgIcon.color; cc.a = 1f; imgIcon.color = cc; } |
| | | if (imgSkillName != null) { var cc = imgSkillName.color; cc.a = 1f; imgSkillName.color = cc; } |
| | | if (canvasGroup != null) { var cc = canvasGroup.alpha; cc = 1f; canvasGroup.alpha = cc; } |
| | | |
| | | transform.localPosition = isRed ? new Vector3(-beginingX, posY, 0f) : new Vector3(beginingX, posY, 0f); |
| | | gameObject.SetActive(false); |
| | |
| | | // 被强制停止时也需要恢复 alpha |
| | | if (imageBg != null) { var cc = imageBg.color; cc.a = 1f; imageBg.color = cc; } |
| | | if (imgIcon != null) { var cc = imgIcon.color; cc.a = 1f; imgIcon.color = cc; } |
| | | if (imgSkillName != null) { var cc = imgSkillName.color; cc.a = 1f; imgSkillName.color = cc; } |
| | | if (canvasGroup != null) { var cc = canvasGroup.alpha; cc = 1f; canvasGroup.alpha = cc; } |
| | | } |
| | | |
| | | } |