Main/Component/UI/Effect/BattleEffectPlayer.cs
@@ -36,8 +36,6 @@
    public float speedRate = 1.5f;
    [Header("播放完毕立即回收")]
    public bool isReleaseImmediately = false;  //界面特效一般不需要自我销毁,跟随界面或者父对象销毁就行
@@ -60,8 +58,6 @@
    protected SkeletonAnimation spineComp;
    protected Spine.AnimationState spineAnimationState;
    protected int heroSetedSortingOrder;
    public GameObjectPoolManager.GameObjectPool pool;
    public Action onComplete;
@@ -72,11 +68,13 @@
    protected virtual void OnEnable()
    {
        if (spineComp != null)
        {
            //隐藏,会有静态显示问题
            spineComp.enabled = false;
        }
        // if (spineComp != null)
        // {
        //     //隐藏,会有静态显示问题
        //     spineComp.enabled = false;
        // }
        ApplySortingOrder();
    }
@@ -128,6 +126,8 @@
        {
            rectTrans.localScale *= effectConfig.effectScale;
        }
        spineComp.loop = effectConfig.isLoop != 0;
    }
    protected virtual void Clear()
@@ -161,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);
        }
    }
@@ -255,7 +260,7 @@
        }
        //  如果delay小于等于0 那会立刻执行
        this.DelayTime(effectConfig.delayPlay, () =>
        this.DelayTime(effectConfig.delayPlay / speedRate, () =>
        {
            PlayEffectInternal();
        });
@@ -296,6 +301,8 @@
        blocker = spineComp.AddMissingComponent<RendererAdjuster>();
        blocker.onSortingChanged = OnSortingChanged;
        ApplySortingOrder();
        spineComp.enabled = true;
@@ -377,7 +384,7 @@
    public string sortingLayer;
    public int sortingOrder;
    private RectTransform rectTrans;
    public RectTransform rectTrans;
    protected void OnSortingChanged(string _sortingLayer, int _sortingOrder)
    {