using UnityEngine;

public class Brakes : MonoBehaviour {

	public float BrakingTractionAsk=2.0f;
	public float BrakeFactor { get; set; }

    private Tire[] tires;
	// Use this for initialization
	void Start () {
        tires = GetComponentsInChildren<Tire>();
	}
	
	// Update is called once per frame
	void Update () {		
		foreach(Tire t in tires)
			if(t.Braking)
				t.CurrentBraking = BrakeFactor * BrakingTractionAsk;
	}
}
