| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (recordPlayer == null || battleObjMgr == null) |
| | | return; |
| | | recordPlayer.Run(); |
| | | battleObjMgr.Run(); |
| | | |
| | |
| | | } |
| | | |
| | | for (int i = 0; i < teamBase.serverHeroes.Length; i++) |
| | | { |
| | | TeamHero teamHero = teamBase.serverHeroes[i]; |
| | | if (teamHero != null) |
| | | { |
| | | TeamHero teamHero = teamBase.serverHeroes[i]; |
| | | if (teamHero != null) |
| | | { |
| | | BattleObject battleObj = BattleObjectFactory.CreateBattleObject(battleField, posNodeList, teamHero, _Camp); |
| | | allBattleObjDict.Add(battleObj.ObjID, battleObj); |
| | | campDict.Add(teamHero.positionNum, battleObj); |
| | | } |
| | | BattleObject battleObj = BattleObjectFactory.CreateBattleObject(battleField, posNodeList, teamHero, _Camp); |
| | | if (battleObj.ObjID == 0) |
| | | continue; |
| | | allBattleObjDict.Add(battleObj.ObjID, battleObj); |
| | | campDict.Add(teamHero.positionNum, battleObj); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public BattleObject GetBattleObject(int objId) |
| | |
| | | motionBase = new MotionBase(); |
| | | motionBase.Init(heroGo.GetComponentInChildren<SkeletonGraphic>(true)); |
| | | motionBase.onAnimationComplete += OnAnimationComplete; |
| | | |
| | | buffMgr = new BattleObjectBuffMgr(); |
| | | buffMgr.Init(this); |
| | | |
| | | renderers = heroGo.GetComponentsInChildren<Renderer>(true); |
| | |
| | | { |
| | | HeroSkinConfig skinCfg = teamHero.skinConfig; |
| | | GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001"/*skinCfg.SpineRes*/); |
| | | SkeletonGraphic skeletonGraphic = battleGO.GetComponent<SkeletonGraphic>(); |
| | | SkeletonGraphic skeletonGraphic = battleGO.GetComponentInChildren<SkeletonGraphic>(); |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinCfg.SpineRes); |
| | | skeletonGraphic.Initialize(true); |
| | | GameObject goParent = posNodeList[teamHero.positionNum]; |
| | |
| | | { |
| | | for (int i = 0; i < team.serverHeroes.Length; i++) |
| | | { |
| | | if (team.serverHeroes[i] == null) |
| | | continue; |
| | | var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid); |
| | | if (hero != null) |
| | | { |
| | |
| | | return new Int2((int)country, maxValue); |
| | | } |
| | | |
| | | //AttackType 0 攻击阵容 1 防守阵容 |
| | | int GetSelectTeamTypeByAttackType(int AttackType) |
| | | //在不同页签下选AttackType 0 攻击阵容 1 防守阵容 |
| | | public int GetSelectTeamTypeByAttackType(int AttackType) |
| | | { |
| | | if (selectTeamType == TeamType.Arena) |
| | | if (selectTeamType == TeamType.Arena || selectTeamType == TeamType.ArenaDefense) |
| | | { |
| | | if (AttackType == 0) |
| | | { |
| | | return (int)TeamType.Arena; |
| | | } |
| | | else if (AttackType == 1) |
| | | { |
| | | return (int)TeamType.ArenaDefense; |
| | | } |
| | | return AttackType == 0 ? (int)TeamType.Arena : (int)TeamType.ArenaDefense; |
| | | } |
| | | else if (selectTeamType == TeamType.ArenaDefense) |
| | | { |
| | | if (AttackType == 0) |
| | | { |
| | | return (int)TeamType.ArenaDefense; |
| | | } |
| | | else if (AttackType == 1) |
| | | { |
| | | return (int)TeamType.Arena; |
| | | } |
| | | } |
| | | |
| | | |
| | | return (int)TeamType.Story; |
| | | } |
| | |
| | | if (!teamDict.TryGetValue(teamType, out team)) |
| | | { |
| | | team = new TeamBase(teamType); |
| | | team.CreateDefault(HeroManager.Instance.GetPowerfulHeroList()); |
| | | teamDict.Add(teamType, team); |
| | | // team.CreateDefault(HeroManager.Instance.GetPowerfulHeroList()); |
| | | // teamDict.Add(teamType, team); |
| | | } |
| | | |
| | | return team; |