public void AddModule(BaseModuleConfig baseModuleConfig) { GameObject gameObject = Instantiate(baseModulePrefab, this.transform.Find("BaseModules")); BaseModule baseModule = gameObject.GetComponent <BaseModule>(); foreach (AgentConfig agentConfig in baseModuleConfig.GetAgentConfigs()) { baseModule.AddAgentConfig(agentConfig); availableAgentTypes.Add(agentConfig); } baseModules.Add(baseModule); }