Example #1
0
    Car_Behaviour InstantiateCar(Vector3 spawnPoint, float[][] hlWeights, float[] hlBiases, float[] OWeights, float OBiases, string name)
    {
        Car_Behaviour behaviour = Instantiate(carPrefab, spawnPoint, Quaternion.identity).GetComponent <Car_Behaviour>();

        behaviour.active       = true;
        behaviour.AIControlled = true;

        if (hlWeights != null || hlBiases != null)
        {
            behaviour.ActivateBrain(hlWeights, hlBiases, OWeights, OBiases);
        }
        else
        {
            behaviour.ActivateBrain();
        }

        behaviour.transform.name = name;
        behaviour.objective      = trackCtrl.trackEnd.position;

        return(behaviour);
    }
Example #2
0
    Car_Behaviour InstantiateCar(Vector3 spawnPoint, NN nN, string name)
    {
        Car_Behaviour behaviour = Instantiate(carPrefab, spawnPoint, Quaternion.identity).GetComponent <Car_Behaviour>();

        if (nN != null)
        {
            behaviour.ActivateBrain(nN);
        }
        else
        {
            behaviour.ActivateBrain();
        }

        behaviour.transform.name = name;
        behaviour.objective      = trackCtrl.trackEnd.position;

        behaviour.active       = true;
        behaviour.AIControlled = true;

        return(behaviour);
    }
Example #3
0
    Car_Behaviour InstantiateCar(Vector3 spawnPoint, string brain, string name, NN.TYPE brainType)
    {
        Car_Behaviour behaviour = Instantiate(carPrefab, spawnPoint, Quaternion.identity).GetComponent <Car_Behaviour>();

        behaviour.active       = true;
        behaviour.AIControlled = true;

        behaviour.transform.name = name;
        behaviour.objective      = trackCtrl.trackEnd.position;
        //behaviour.type = brainType;

        if (brain != null)
        {
            behaviour.ActivateBrain(brain);
        }
        else
        {
            behaviour.ActivateBrain();
        }

        return(behaviour);
    }