| | |
| | | HeroSkinConfig skinCfg = teamHero.skinConfig; |
| | | if (skinCfg == null) |
| | | { |
| | | BattleDebug.LogError(teamHero.heroId + "BattleObjectFactory.CreateBattleObject: skinCfg is null for " + teamHero.SkinID); |
| | | Debug.LogError(teamHero.heroId + "BattleObjectFactory.CreateBattleObject: skinCfg is null for " + teamHero.SkinID); |
| | | return null; |
| | | } |
| | | |
| | | GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001"/*skinCfg.SpineRes*/); |
| | | |
| | | if (battleGO == null) |
| | | { |
| | | BattleDebug.LogError("BattleObjectFactory.CreateBattleObject: battleGO is null for " + teamHero.heroId); |
| | | return null; |
| | | } |
| | | |
| | | BattleDebug.LogError("1 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum); |
| | | |
| | | GameObject goParent = posNodeList[teamHero.positionNum]; |
| | | BattleObject battleObject = new BattleObject(_battleField); |
| | |
| | | var skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | if (skeletonDataAsset == null) |
| | | { |
| | | BattleDebug.LogError("BattleObjectFactory.CreateBattleObject: skeletonDataAsset is null for " + skinCfg.SpineRes); |
| | | Debug.LogError("BattleObjectFactory.CreateBattleObject: skeletonDataAsset is null for " + skinCfg.SpineRes); |
| | | return null; |
| | | } |
| | | |
| | | BattleDebug.LogError("2 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum); |
| | | |
| | | float finalScaleRate = modelScaleRate * teamHero.modelScale; |
| | | |
| | |
| | | rectTrans.anchoredPosition = Vector2.zero; |
| | | battleObject.Init(realGO, teamHero, _Camp); |
| | | |
| | | BattleDebug.LogError(realGO.name + " /3 BattleObjectFactory.CreateBattleObject: Creating BattleObject for " + teamHero.ObjID + " at position " + teamHero.positionNum); |
| | | |
| | | |
| | | return battleObject; |
| | | } |
| | | |
| | | public static void DestroyBattleObject(int key, BattleObject battleObj) |
| | | { |
| | | BattleDebug.LogError("BattleObject destroy"); |
| | | battleObj.Destroy(); |
| | | battleObj = null; |
| | | } |