public void CreateTeamAIFactory(int i_TeamIndex, tnTeamDescription i_TeamDescription) { if (!m_SetupDone) { return; } if (i_TeamIndex < 0 || i_TeamIndex >= m_AIFactories.Length || i_TeamIndex >= m_TeamSizes.Length) { return; } if (i_TeamDescription == null) { return; } ClassTypeReference newAIFactoryType = (i_TeamIndex % 2 == 0) ? m_EvenTeamAIFactoryType : m_OddTeamAIFactoryType; tnBaseSubbuteoMatchAIFactory newAIFactory = CSharpUtils.Cast <tnBaseSubbuteoMatchAIFactory>(Activator.CreateInstance(newAIFactoryType)); if (newAIFactory != null) { newAIFactory.Configure(i_TeamDescription); } m_AIFactories[i_TeamIndex] = newAIFactory; m_TeamSizes[i_TeamIndex] = i_TeamDescription.charactersCount; }