private void StartLearning()
    {
        Transform           spawn  = raceCreator.GetRandomPosition();
        NeuralNetworkDriver driver = Instantiate(annDriver, spawn.position, spawn.rotation);

        driver.InitLearning();
        cameraFollow.SetTarget(driver.transform);
        playerDataRecorder.gameObject.SetActive(false);
    }
Exemplo n.º 2
0
 public void InitRace()
 {
     numOfEnemies = Mathf.Min(numOfEnemies, startPositions.Length);
     for (int i = 0; i < numOfEnemies; i++)
     {
         NeuralNetworkDriver enemy = Instantiate(enemyCarPrefab, startPositions[i].position, startPositions[i].rotation);
         enemy.SetWeightFile(driverData[i % driverData.Length]);
     }
 }
 protected override void Awake()
 {
     base.Awake();
     ann = GetComponent <NeuralNetworkDriver>();
 }