lcy
10 小时以前 ebe6f848bb02da9718bac31ff3d581a856af0a3e
Main/System/Battle/UIComp/SkillTips.cs
@@ -12,10 +12,10 @@
    public const float beginingX = 400f;
    [SerializeField]public Image imgIcon;
    [SerializeField] public Image imgIcon;
    [SerializeField]public Image imgSkillName;
    [SerializeField] public GradientText txtSkillName;
    [SerializeField] public CanvasGroup canvasGroup;
    [SerializeField] public Image imageBg;
    private Tween tween1;
@@ -35,12 +35,12 @@
        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;
@@ -59,8 +59,8 @@
                    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(() =>
                {
@@ -68,7 +68,7 @@
                    // 恢复图片 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);
@@ -81,7 +81,7 @@
        });
        battleField.battleTweenMgr.OnPlayTween(tween1);
    }
    public void KillAllTweens()
    {
        if (tween1 != null)
@@ -103,7 +103,7 @@
        // 被强制停止时也需要恢复 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; }
    }
}