Main/Component/UI/Effect/BattleEffectPlayer.cs
@@ -58,8 +58,6 @@
    protected SkeletonAnimation spineComp;
    protected Spine.AnimationState spineAnimationState;
    protected int heroSetedSortingOrder;
    public GameObjectPoolManager.GameObjectPool pool;
    public Action onComplete;
@@ -70,11 +68,13 @@
    protected virtual void OnEnable()
    {
        if (spineComp != null)
        {
            //隐藏,会有静态显示问题
            spineComp.enabled = false;
        }
        // if (spineComp != null)
        // {
        //     //隐藏,会有静态显示问题
        //     spineComp.enabled = false;
        // }
        ApplySortingOrder();
    }
@@ -126,6 +126,8 @@
        {
            rectTrans.localScale *= effectConfig.effectScale;
        }
        spineComp.loop = effectConfig.isLoop != 0;
    }
    protected virtual void Clear()
@@ -159,24 +161,29 @@
        onComplete?.Invoke();
    }
    public void SetSortingOrder(int _heroSetedSortingOrder)
    public Func<bool> funcIsHeroFront;
    public void SetSortingOrder(Func<bool> _isHeroFrontCallback)
    {
        heroSetedSortingOrder = _heroSetedSortingOrder;
        funcIsHeroFront = _isHeroFrontCallback;
        int so = heroSetedSortingOrder;
        ApplySortingOrder();
    }
        if (null != blocker && effectConfig != null)
    public void ApplySortingOrder()
    {
        if (null != blocker && effectConfig != null && funcIsHeroFront != null)
        {
            if (BattleConst.UnactiveHeroSortingOrder == heroSetedSortingOrder)
            {
                so = effectConfig.frontBack == 1 ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder;
            }
            else
            {
                so = effectConfig.frontBack == 1 ? BattleConst.ActiveHeroFrontSortingOrder : BattleConst.ActiveHeroBackSortingOrder;
            }
            bool isEffectFront = effectConfig.frontBack == 1;
            blocker.SetSortingOrder(so);
            bool isHeroFront = funcIsHeroFront();
            int finalSortingOrder = isHeroFront ?
                (isEffectFront ? BattleConst.ActiveHeroActionSortingOrder : BattleConst.ActiveHeroBackSortingOrder) : (isEffectFront ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder);
            blocker.SetSortingOrder(finalSortingOrder);
        }
    }
@@ -295,19 +302,7 @@
        blocker.onSortingChanged = OnSortingChanged;
        if (0 != heroSetedSortingOrder)
        {
            if (BattleConst.UnactiveHeroSortingOrder == heroSetedSortingOrder)
            {
                heroSetedSortingOrder = effectConfig.frontBack == 1 ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder;
            }
            else
            {
                heroSetedSortingOrder = effectConfig.frontBack == 1 ? BattleConst.ActiveHeroFrontSortingOrder : BattleConst.ActiveHeroBackSortingOrder;
            }
            blocker.SetSortingOrder(heroSetedSortingOrder);
        }
        ApplySortingOrder();
        spineComp.enabled = true;