yyl
昨天 f4da988ce76d8ad87f195ad9d98176b3dcb7622b
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;
@@ -75,6 +73,8 @@
            //隐藏,会有静态显示问题
            spineComp.enabled = false;
        }
        ApplySortingOrder();
    }
@@ -159,24 +159,29 @@
        onComplete?.Invoke();
    }
    public void SetSortingOrder(int _heroSetedSortingOrder)
    {
        heroSetedSortingOrder = _heroSetedSortingOrder;
    public Func<bool> funcIsHeroFront;
        int so = heroSetedSortingOrder;
    public void SetSortingOrder(Func<bool> _isHeroFrontCallback)
    {
        funcIsHeroFront = _isHeroFrontCallback;
        if (null != blocker && effectConfig != null)
        {
            if (BattleConst.UnactiveHeroSortingOrder == heroSetedSortingOrder)
            {
                so = effectConfig.frontBack == 1 ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder;
            }
            else
            {
                so = effectConfig.frontBack == 1 ? BattleConst.ActiveHeroFrontSortingOrder : BattleConst.ActiveHeroBackSortingOrder;
        ApplySortingOrder();
            }
            blocker.SetSortingOrder(so);
    public void ApplySortingOrder()
    {
        if (null != blocker && effectConfig != null && funcIsHeroFront != null)
        {
            bool isEffectFront = effectConfig.frontBack == 1;
            bool isHeroFront = funcIsHeroFront();
            int finalSortingOrder = isHeroFront ?
                (isEffectFront ? BattleConst.ActiveHeroActionSortingOrder : BattleConst.ActiveHeroBackSortingOrder) : (isEffectFront ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder);
            blocker.SetSortingOrder(finalSortingOrder);
        }
    }
@@ -295,19 +300,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;