/// <summary>语言包加载完成</summary> private void OnComplete_LoadedLang() { TextManager.SetQueryString(); ItemManager.Init(); CommonConfig.Init(); LotterRewardManager.Init(); SuitConfig.Init(); ClothesConfig.Init(); ClothesSlevelConfig.Init(); ClothesLevelConfig.Init(); BabyLikingConfig.Init(); UseEquipConfig.Init(); ClothesInheritConfig.Init(); ClothesMapConfig.Init(); CloneLevelConfig.Init(); LevelRewardConfig.Init(); ArenaConfig.Init(); SkillLevelConfig.Init(); PropertySkillLevelConfig.Init(); BossDailyConfig.Init(); BossRewardConfig.Init(); InstanceProxy.Get <PieceSwitchConfig>().LoadXml(); InstanceProxy.Get <PlayerPositionConfig>().LoadXml(); InstanceProxy.Get <MatchArrayConfig>().LoadXml(); InstanceProxy.Get <PositionAttributeConfig>().LoadXml(); InstanceProxy.Get <RandNameConfig>().LoadXml(); InstanceProxy.Get <SkinConfig>().LoadXml(); InstanceProxy.Get <MonsterConfig>().LoadXml(); InstanceProxy.Get <CloneConfig>().LoadXml(); InstanceProxy.Get <CameraConfig>().LoadXml(); InstanceProxy.Get <MentalityMaxConfig>().LoadXml(); InstanceProxy.Get <AbilityConfig>().LoadXml(); InstanceProxy.Get <SkillConfig>().LoadXml(); InstanceProxy.Get <SkillAIConfig>().LoadXml(); }
private void Inject(ArenaConfig config, Player player, EnemyPool enemyPool, BonusPool bonusPool) { _config = config; _player = player; _enemyPool = enemyPool; _bonusPool = bonusPool; }
public void UpdateArenaRankGrid(UIGridItem item) { if (item == null || item.mScripts == null || item.oData == null) { return; } ArenaInfo info = item.oData as ArenaInfo; UILabel ranking = item.mScripts[0] as UILabel; UITexture head = item.mScripts[1] as UITexture; UILabel name = item.mScripts[2] as UILabel; UILabel formation = item.mScripts[3] as UILabel; UILabel fight = item.mScripts[4] as UILabel; UISprite select = item.mScripts[5] as UISprite; UITexture clubHead = item.mScripts[6] as UITexture; UILabel clubName = item.mScripts[7] as UILabel; UILabel dimaondLabel = item.mScripts[8] as UILabel; UILabel blackLabel = item.mScripts[9] as UILabel; UISprite rankSprite = item.mScripts[10] as UISprite; item.onClick = OnClickArenaItem; LoadSprite.LoaderHead(head, "jueshetouxiang1", false); LoadSprite.LoaderHead(clubHead, "jueshetouxiang1", false); select.gameObject.SetActive(info.dbid == PlayerMediator.playerInfo.roleId && info.playerName == PlayerMediator.playerInfo.name); if (select.gameObject.activeSelf) { arenaInfo = info; } clubName.text = info.club; rankSprite.gameObject.SetActive(info.ranking <= 3); ranking.gameObject.SetActive(info.ranking > 3); if (info.ranking <= 3) { rankSprite.spriteName = info.ranking.ToString(); } else { ranking.text = info.ranking.ToString(); } name.text = info.playerName; formation.text = info.formation.ToString(); fight.text = info.fightValue.ToString(); ArenaReward reward = ArenaConfig.GetArenaRewardByRank(info.ranking); if (reward == null) { dimaondLabel.text = "0"; blackLabel.text = "0"; } else { dimaondLabel.text = reward.arenaReward.Split(';')[1].ToString(); blackLabel.text = reward.arenaReward.Split(';')[0].ToString(); } }
private void LoadArenaToEdit(ArenaConfig arenaConfig) { editArena_ = arenaConfig; string dynamicArenaDataJson = editArena_.GetDynamicArenaDataJson(); if (string.IsNullOrEmpty(dynamicArenaDataJson)) { dynamicArenaData_ = new DynamicArenaData(); } else { dynamicArenaData_ = JsonUtility.FromJson <DynamicArenaData>(dynamicArenaDataJson); } undoHistory_ = new UndoHistory(dynamicArenaData_, inputDevice_); dynamicArenaView_.Init(dynamicArenaData_, editArena_.Prefab); dynamicArenaView_.OnViewRefreshed += HandleArenaViewRefreshed; }
private void OnGUI() { EditorGUI.BeginChangeCheck(); _arenaConfig = EditorGUILayout.ObjectField("Arena config", _arenaConfig, typeof(ArenaConfig), false) as ArenaConfig; if (EditorGUI.EndChangeCheck()) { if (_arenaConfig != null) { _arenaIndexes = new int[_arenaConfig.Arenas.Length]; _arenaIndexDisplays = new string[_arenaConfig.Arenas.Length]; for (int i = 0; i < _arenaIndexes.Length; i++) { _arenaIndexes[i] = i; _arenaIndexDisplays[i] = i.ToString(); } } } if (_arenaConfig == null || _arenaConfig.Arenas.Length == 0) { return; } _currentArenaIndex = EditorGUILayout.IntPopup("Arena", _currentArenaIndex, _arenaIndexDisplays, _arenaIndexes); _currentArenaData = _arenaConfig.Arenas[_currentArenaIndex]; if (GUILayout.Button("Open editor")) { CellsEditorWindow.Open(_currentArenaData); } if (GUILayout.Button("Save")) { EditorUtility.SetDirty(_arenaConfig); AssetDatabase.Refresh(); } }
public void Init(CoopLevelConfig config) { config_ = config; configArenas_ = new ArenaConfig[] { config.ArenaConfig }; waves_ = new HashSet <WaveAttributeMarker> [GameConstants.Instance.MaxNumberOfWaves + 1]; }
// 服务器确认,开始战斗 public void OnStartBattle(S2C_StartBattle data) { // 设置随机数种子 UnityEngine.Random.seed = data.RandomSeed; _battleState = State.GAME; ServerTurnIndex = 0; ClientTurnIndex = 0; _accumilatedTime = 0; Mana = GameConfig.START_MANA * GameConfig.MANA_MUL; // 清理出牌卡组 DeckCardList.Clear(); DeckCardList.AddRange(CardList); // 创建塔 ArenaConfig cfg = ArenaConfigLoader.GetConfig(_arenaID); if (cfg == null) { return; } _enemyTower.Clear(); // 判定主客场 只有判定了主客场,才能开始整场战斗 if (data.UserID1 == UserID) { // 主场 我在左边 IsHomeCourt = true; // 敌人的id和等级 EnemyUserID = data.UserID2; EnemyUserLevel = data.UserLevel2; // 创建我方的塔 (我在左边) // 主场玩家左侧为我方塔,右侧为敌方塔,非主场玩家则相反。 将来统一坐标系后再考虑玩家统一在左方,现在双方玩家跟服务器坐标一致,通过塔的颜色来区分 _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, UserLevel, cfg.TowerLeft1, UserID)); _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, UserLevel, cfg.TowerLeft2, UserID)); _enemyTower.Add(CreateTower(GameConfig.KING_TOWER_ID, UserLevel, cfg.CastleLeft, UserID)); // 创建敌方的塔 _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, EnemyUserLevel, cfg.TowerRight1, EnemyUserID)); _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, EnemyUserLevel, cfg.TowerRight2, EnemyUserID)); _enemyTower.Add(CreateTower(GameConfig.KING_TOWER_ID, EnemyUserLevel, cfg.CastleRight, EnemyUserID)); } else { // 客场,我在右边 IsHomeCourt = false; // 敌人的id和等级 EnemyUserID = data.UserID1; EnemyUserLevel = data.UserLevel1; // 创建我方的塔 (我在右边) _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, UserLevel, cfg.TowerRight1, UserID)); _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, UserLevel, cfg.TowerRight2, UserID)); _enemyTower.Add(CreateTower(GameConfig.KING_TOWER_ID, UserLevel, cfg.CastleRight, UserID)); // 创建敌方的塔 _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, EnemyUserLevel, cfg.TowerLeft1, EnemyUserID)); _enemyTower.Add(CreateTower(GameConfig.TOWER_ID, EnemyUserLevel, cfg.TowerLeft2, EnemyUserID)); _enemyTower.Add(CreateTower(GameConfig.KING_TOWER_ID, EnemyUserLevel, cfg.CastleLeft, EnemyUserID)); } // 产生4张卡牌 const float TIME = 0.3f; PushNewCard(0, null, 0); PushNewCard(1, null, TIME * 1); PushNewCard(2, null, TIME * 2); PushNewCard(3, null, TIME * 3); // 生成下一张卡牌 GenerateCard(); }