예제 #1
0
    private void HandleTriggerEvent(Collider other)
    {
        // decide what to do depending on what we have collided with
        switch (other.transform.tag)
        {
        case "TrafficLight":
            // Debug.Log("Hit a traffic light..");
            TrafficLightController theTLC = other.transform.GetComponent <TrafficLightController>();
            RespondToTrafficLight(theTLC.GetTrafficLightStatus());
            break;

        case "Vehicle":
            m_carStatus   = CarStatus.Stopped;
            m_TargetSpeed = 0;
            break;

        default:
            break;
        }
    }