Ejemplo n.º 1
0
    private Vector3 CalculateLaneLocation(int lane)
    {
        var offset = DrivingAgent.GetLaneOffset(lane + 1);
        var left   = Vector3.Cross(Vector3.up, directionToNeighbour).normalized;

        return(wp.transform.position - left * offset);
    }
    // Use this for initialization
    void Start()
    {
        vehicle = gameObject.GetComponent <DrivingAgent>();

        vehiclesAtJunctionsLayerMask = LayerMask.NameToLayer(VehiclesAtJunctionsLayer);
        vehiclesOnRoadsLayerMask     = LayerMask.NameToLayer(VehiclesOnRoadsLayer);

        if (AvoidCollisionsAtJunctions)
        {
            Physics.IgnoreLayerCollision(
                vehiclesAtJunctionsLayerMask,
                vehiclesAtJunctionsLayerMask
                );
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Awake()
 {
     DA = GetComponent <DrivingAgent>();
     PF = FindObjectOfType <PerformanceMeasurer>();
 }