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 SetStadium(tnMatchSettingsModule i_Module) { if (i_Module == null) { return; } if (m_StadiumSelector == null || m_StadiumSelector.currentItem == null) { return; } int stadiumId = m_StadiumSelector.currentItem.id; i_Module.SetStadiumId(stadiumId); LogManager.Log(this, LogContexts.FSM, "Stadium : " + m_StadiumSelector.currentItem.label + " " + "[" + m_StadiumSelector.currentItem.id + "]"); }
public override void OnEnter() { tnMatchSettingsModule module = GameModulesManager.GetModuleMain <tnMatchSettingsModule>(); if (module == null) { module = GameModulesManager.AddModuleMain <tnMatchSettingsModule>(); } module.Clear(); module.SetGameModeId(gameModeId.Value); module.SetStadiumId(stadiumId.Value); module.SetBallId(ballId.Value); module.SetMatchDurationOption(matchDurationOption.Value); module.SetRefereeOption(refereeOption.Value); module.SetGoldenGoalOption(goldenGoalOption.Value); Finish(); }
private void Internal_FillMatchSettingsModule() { tnMatchSettingsModule module = GameModulesManager.GetModuleMain <tnMatchSettingsModule>(); if (module == null) { return; } string gameModeId = GetGameModeId(m_GameMode); string ballId = GetBallId(m_Ball); string stadiumId = GetStadiumId(m_Stadium); string matchDurationOptionId = GetMatchDurationOptionId(m_MatchDuration); string goldenGoalOptionId = GetGoldenGoalOptionId(m_GoldenGoal); string refereeOptionId = GetRefereeOptionId(m_Referee); module.SetGameModeId(gameModeId); module.SetBallId(ballId); module.SetStadiumId(stadiumId); module.SetMatchDurationOption(matchDurationOptionId); module.SetGoldenGoalOption(goldenGoalOptionId); module.SetRefereeOption(refereeOptionId); }