private Brain BreedNewCharacter()
        {
            GameObject newCharacter = GameObject.Instantiate(this._characterToSpawn, this._spawnPosition.transform.position, this.transform.rotation, this.transform);
            Brain      brain        = newCharacter.GetComponent <Brain>();

            brain.Start();
            return(brain);
        }
Пример #2
0
        private Brain BreedNewCharacter()
        {
            Vector3    startingPosition = this.GetNewSpawningPosition();
            GameObject newCharacter     = GameObject.Instantiate(this._characterToSpawn, startingPosition, this.transform.rotation, this.transform);
            Brain      brain            = newCharacter.GetComponent <Brain>();

            brain.Start();
            return(brain);
        }
 private void SpawnInitialPopulation()
 {
     for (int i = 0; i < this._populationSize; i++)
     {
         Brain brain = this.BreedNewCharacter();
         brain.DNA = DNA.CreateRandomDna();
         brain.Start();
     }
 }