Esempio n. 1
0
        public override void OnEnter()
        {
            tnTeamsModule teamsModule = GameModulesManager.GetModuleMain <tnTeamsModule>();

            if (teamsModule == null)
            {
                teamsModule = GameModulesManager.AddModuleMain <tnTeamsModule>();
                teamsModule.Clear();
            }

            tnTeamDescription team = new tnTeamDescription();

            team.SetTeamId(id.Value);
            team.SetTeamColor(color.Value);

            int charactersCount = characters.Length;

            for (int characterIndex = 0; characterIndex < charactersCount; ++characterIndex)
            {
                tnCharacterEntry entry = characters[characterIndex];
                if (entry != null)
                {
                    FsmString characterId       = entry.characterId;
                    FsmInt    onlinePlayerIndex = entry.onlinePlayerIndex;
                    FsmString playerId          = entry.playerId;
                    FsmInt    spawnOrder        = entry.spawnOrder;

                    if (characterId != null && !characterId.IsNone && onlinePlayerIndex != null && !onlinePlayerIndex.IsNone && playerId != null && !playerId.IsNone && spawnOrder != null && !spawnOrder.IsNone)
                    {
                        tnCharacterDescription character = new tnCharacterDescription();

                        character.SetCharacterId(characterId.Value);

                        character.SetOnlinePlayerIndex(onlinePlayerIndex.Value);

                        character.SetPlayerId(playerId.Value);
                        character.SetSpawnOrder(spawnOrder.Value);

                        team.AddCharacterDescription(character);
                    }
                }
            }

            teamsModule.AddTeamDescription(team);

            Finish();
        }
        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();
        }
Esempio n. 3
0
 public override void OnEnter()
 {
     GameModulesManager.AddModuleMain <T>();
     Finish();
 }