public void Init() { /* * 0 forward * 1 back * 2 left * 3 right * 4 jump * 5 crouch */ dna = new DNAW(DNALength, 6); m_Character = GetComponent <ThirdPersonCharacter>(); timeAlive = 0; alive = true; }
public void Combine(DNAW d1, DNAW d2) { for (int i = 0; i < dnaLength; i++) { if (i < dnaLength / 2.0) { int c = d1.genes[i]; genes[i] = c; } else { int c = d2.genes[i]; genes[i] = c; } } }