private void SetupMatchSettingsModule() { tnMatchSettingsModule module = GameModulesManager.GetModuleMain <tnMatchSettingsModule>(); if (module == null) { return; } module.Clear(); // Game mode. { module.SetGameModeId(gameMode.Value); } // Stadium. { int stadiumKey = -1; GetRandomStadiumKey(gameMode.Value, out stadiumKey); module.SetStadiumId(stadiumKey); } // Ball. { int ballKey = -1; GetRandomBallKey(out ballKey); module.SetBallId(ballKey); } // Ai level. { module.SetAILevelIndex(tnGameData.aiLevelCountMain - 1); } // Options. { tnGameModeData gameModeData = tnGameData.GetGameModeDataMain(gameMode.Value); if (gameModeData != null) { tnGameModeConfig gameModeConfig = tnGameData.GetConfigDataMain(gameModeData.optionsConfigId); if (gameModeConfig != null) { module.SetMatchDurationOption(gameModeConfig.matchDurationOption); module.SetRefereeOption(gameModeConfig.refereeOption); } } } }
private void SetAILevelIndex(tnMatchSettingsModule i_Module) { if (i_Module == null) { return; } if (m_AILevelSelector == null || m_AILevelSelector.currentItem == null) { return; } int aiLevelIndex = m_AILevelSelector.currentItem.id; i_Module.SetAILevelIndex(aiLevelIndex); LogManager.Log(this, LogContexts.FSM, "Ai Level : " + m_AILevelSelector.currentItem.label + " " + "[" + m_AILevelSelector.currentItem.id + "]"); }