yyl
2025-08-25 cec8b67d82c2c2c1662d55c818c4a46bcc0487db
Main/System/Battle/BattleObject/BattleObjectFactory.cs
@@ -17,7 +17,7 @@
        HeroSkinConfig skinCfg = teamHero.skinConfig;
        if (skinCfg == null)
        {
            Debug.LogError(teamHero.heroId + "BattleObjectFactory.CreateBattleObject: skinCfg is null for " + teamHero.SkinID);
            BattleDebug.LogError(teamHero.heroId + "BattleObjectFactory.CreateBattleObject: skinCfg is null for " + teamHero.SkinID);
            return null;
        }
@@ -25,11 +25,11 @@
        if (battleGO == null)
        {
            Debug.LogError("BattleObjectFactory.CreateBattleObject: battleGO is null for " + teamHero.heroId);
            BattleDebug.LogError("BattleObjectFactory.CreateBattleObject: battleGO is null for " + teamHero.heroId);
            return null;
        }
        Debug.LogError("1 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        BattleDebug.LogError("1 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        GameObject goParent = posNodeList[teamHero.positionNum];
        BattleObject battleObject = new BattleObject(_battleField);
@@ -41,11 +41,11 @@
        var skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes);
        if (skeletonDataAsset == null)
        {
            Debug.LogError("BattleObjectFactory.CreateBattleObject: skeletonDataAsset is null for " + skinCfg.SpineRes);
            BattleDebug.LogError("BattleObjectFactory.CreateBattleObject: skeletonDataAsset is null for " + skinCfg.SpineRes);
            return null;
        }
        Debug.LogError("2 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        BattleDebug.LogError("2 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        float finalScaleRate = modelScaleRate * teamHero.modelScale;
@@ -53,10 +53,11 @@
        skeletonGraphic.Initialize(true);
        realGO.name = battleObject.ObjID.ToString();
        realGO.transform.localScale = new Vector3(finalScaleRate, finalScaleRate, finalScaleRate);
        (realGO.transform as RectTransform).anchoredPosition = Vector2.zero;
        RectTransform rectTrans = realGO.GetComponent<RectTransform>();
        rectTrans.anchoredPosition = Vector2.zero;
        battleObject.Init(realGO, teamHero, _Camp);
        Debug.LogError(realGO.name +  " /3 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        BattleDebug.LogError(realGO.name +  " /3 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum);
        return battleObject;
@@ -64,7 +65,7 @@
    public static void DestroyBattleObject(int key, BattleObject battleObj)
    {
        Debug.LogError("BattleObject destroy");
        BattleDebug.LogError("BattleObject destroy");
        battleObj.Destroy();
        battleObj = null;
    }