private void CreateNewBot(int curBotId, Vector3 botPos, GeneScore baseGene, List <GeneScore> crossoverCandidates) { GameObject curBot = Instantiate(ragdoll, botPos, Quaternion.identity) as GameObject; RagdollController ragdollController = curBot.GetComponent <RagdollController>(); ragdollController.Initialize(this, "G" + curGeneration.ToString() + "B" + curBotId.ToString()); if (baseGene == null) { ragdollController.StartMoving(GetNewGene(ragdollController.GetNumOfJoints())); } else { if (curBotId == 0) { ragdollController.StartMoving(baseGene.CreateForceGeneCopy()); } else { ragdollController.StartMoving(GetCrossoverAndMutatedGene(baseGene, crossoverCandidates)); } } }