private void OnTriggerEnter2D(Collider2D other) { if (trafficLamp == TrafficManager.TrafficLampStatus.Red) { if (other.CompareTag("Car")) { currentCar = other.GetComponent <CarBehaviour>(); currentCar.Stop(); } } }