yyl
2025-09-15 6a10188f3eddc740b9b8b1e7eefb0e2fdb3850e3
Main/System/Battle/BattleObject/BattleObject.cs
@@ -32,6 +32,8 @@
    public BattleObjectBuffMgr buffMgr;
    public BattleObjectLayerMgr layerMgr;
    public int ObjID { get; set; }
    public BattleCamp Camp { get; protected set; }
@@ -65,8 +67,6 @@
        }
    }
    public int sortingOrder = 0;
    protected Action onDeathAnimationComplete;
    protected Renderer[] renderers;
@@ -89,6 +89,9 @@
        buffMgr = new BattleObjectBuffMgr();
        buffMgr.Init(this);
        layerMgr = new BattleObjectLayerMgr();
        layerMgr.Init(this);
        renderers = heroGo.GetComponentsInChildren<Renderer>(true);
        heroInfoBar = heroGo.GetComponentInChildren<BattleHeroInfoBar>(true);
@@ -100,7 +103,7 @@
        heroInfoBar.transform.localScale = heroInfoBarScale;
        heroInfoBar.SetActive(true);
        SetToFront();
        SetFront();
    }
@@ -389,7 +392,7 @@
        heroRectTrans.anchoredPosition = Vector2.zero;
        heroInfoBar.SetActive(false);
        SetToFront();
        SetFront();
    }
    public void PushDropItems(BattleDrops _battleDrops)
@@ -411,34 +414,19 @@
        battleDrops = null;
    }
    public void SetToBack()
    public void SetBack()
    {
        sortingOrder = BattleConst.UnactiveHeroSortingOrder;
        UpdateSortingOrder();
        layerMgr.SetBack();
    }
    public void SetToFront()
    public void SetFront()
    {
        sortingOrder = BattleConst.ActiveHeroSortingOrder;
        UpdateSortingOrder();
        layerMgr.SetFront();
    }
    private void UpdateSortingOrder()
    public void SetSpeedRatio(float ratio)
    {
        if (null == renderers) return;
        foreach (var renderer in renderers)
        {
            if (renderer != null)
            {
                renderer.sortingOrder = sortingOrder;
            }
        }
    }
    public int GetSortingOrder()
    {
        return sortingOrder;
        motionBase.SetSpeedRatio(ratio);
    }